-
Notifications
You must be signed in to change notification settings - Fork 24k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Android] [TouchableNativeFeedback] parent pressed state also applied to child elements #3952
Labels
Help Wanted
Issues ideal for external contributors.
Resolution: Locked
This issue was locked by the bot.
Comments
+1 |
+1 |
Thanks @astuetz for the great bug report. I managed to find the problem and fixed it! |
@janicduplessis Awesome, thanks! |
zebulgar
pushed a commit
to nightingale/react-native
that referenced
this issue
Jun 18, 2016
Summary:For some reason Android propagates the the pressed state to all of the ViewGroup's children when calling `setPressed`. This caused the issue described in facebook#3952. Luckily we can override the `dispatchSetPressed` method of ViewGroup to prevent it from doing so. Had to dig in the Android source a bit to find this one, here's the relevant pieces : https://github.com/android/platform_frameworks_base/blob/master/core/java/android/view/View.java#L7883 https://github.com/android/platform_frameworks_base/blob/master/core/java/android/view/ViewGroup.java#L3722 **Test plan (required)** Reproduced the bug using [this gist](https://gist.github.com/janicduplessis/9f1d42c670aefd660afb4c96e8bb6a4f) in UIExplorer. Touching the parent should not trigger the ripple on the children. I also made sure all the touchable still work properly. Fixes facebook#3952 Closes facebook#6783 Differential Revision: D3133407 fb-gh-sync-id: 317e55de2652ea185a1082cd96b8fe3a8b807962 fbshipit-source-id: 317e55de2652ea185a1082cd96b8fe3a8b807962
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
Help Wanted
Issues ideal for external contributors.
Resolution: Locked
This issue was locked by the bot.
react-native: 0.14.0-rc
If I have a parent view which is wrapped into an TouchableNativeFeedback element and this parent view has children which are also wrapped into TouchableNativeFeedback, the child elements also show the pressed state as soon as I press the parent.
Already spent some time looking into TouchableNativeFeedback.android.js but I guess that's a problem somewhere deeper.
Kinda behaves like I set the
android:duplicateParentState
to true on a View.http://developer.android.com/reference/android/view/View.html#attr_android:duplicateParentState
The text was updated successfully, but these errors were encountered: