question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Android] Pointer Events box-none not working after react-native 66

See original GitHub issue

Bug

Before react-native 66 pointer events, box-none worked as expected on Android. It preserved the interactive area to the actual area that was painted. After the update made in react native 66 (https://reactnative.dev/blog/2021/10/01/version-066 more specifically https://github.com/facebook/react-native/pull/29039/files) that stopped working.

That can be seen on the snacks below when trying to select the blue section behind the red section. Before react native 66 you can do that and after the blue section can only be selected outside the box of the red section.

Working on react-native 64 https://snack.expo.dev/@amorales85/react-native-svg---box_none-working

Not working on react-native 68 https://snack.expo.dev/@amorales85/react-native-svg---box-none-not-working-properly

Unexpected behavior

Working on react-native 64 https://snack.expo.dev/@amorales85/react-native-svg---box_none-working

Not working on react-native 68 https://snack.expo.dev/@amorales85/react-native-svg---box-none-not-working-properly

Environment info

React native info output:

    OS: macOS 12.4
    CPU: (10) arm64 Apple M1 Pro
    Memory: 123.67 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.14.0 - ~/.nvm/versions/node/v16.14.0/bin/node
    Yarn: 1.22.17 - ~/.nvm/versions/node/v16.14.0/bin/yarn
    npm: 8.3.1 - ~/.nvm/versions/node/v16.14.0/bin/npm
    Watchman: 2022.05.23.00 - /opt/homebrew/bin/watchman
  Managers:
    CocoaPods: 1.11.3 - /Users/andremorales/.rvm/gems/ruby-2.7.4/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
    Android SDK: Not Found
  IDEs:
    Android Studio: 2021.1 AI-211.7628.21.2111.8139111
    Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.11 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2 
    react-native: 0.68.2 => 0.68.2 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Library version: 12.4.0

Steps To Reproduce

Can see the issue happening in this snack: https://snack.expo.dev/@amorales85/react-native-svg---box-none-not-working-properly that usese react-native 68.

Short, Self Contained, Correct (Compilable), Example

N/A I think.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
WoLewickicommented, Sep 19, 2022

@labmorales did passing pointerEvents directly to SvgView ever work? Looking at the props passed here: https://github.com/react-native-svg/react-native-svg/blob/7b7ca40262b29a5b5fc777849537ab58a5bb9c2d/src/elements/Svg.tsx, there is no pointerEvents prop sent to the native side. Or am I missing something?

1reaction
labmoralescommented, Aug 29, 2022

That’s very strange. This bug was filed before version 13. All the tests were made using version 12.4.4. Are you sure you did not revert the react-native version to a version lower than 66?

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Android] Pointer Events box-none not working after react ...
Bug Before react-native 66 pointer events, box-none worked as expected on Android. It preserved the interactive area to the actual area that ...
Read more >
pointerEvents={'none'} not work in Android Expo React Native
I found that we can disable it by using pointerEvents={'none'}. When I added it, then it's working in iOS, but not working in...
Read more >
Using pointerEvents in React Native - LogRocket Blog
In this article, we will look at how to use React Native pointerEvents to help determine how a View interacts with touch events....
Read more >
Pointer Events in React Native
The Pointer Events specification builds on mouse events and aims to provide a single set of events and interfaces for cross-device pointer input ......
Read more >
pointer-event - npm search
React Native Touch Through View is a simple component library that allows for scroll views and table views to scroll over interactable content...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found