Repository navigation
fix(touchable-ripple): clear a ripple left by a disabling press - #5268
Merged
Merged
Conversation
The native pressed state is only cleared by the ripple's own press out, and the ripple was dropped as soon as the touchable became disabled. A press that disabled it left the pressed layer drawn, also after it was enabled again. The ripple is now kept while disabled; a disabled view never presses, so it shows nothing.
Removed detailed comments regarding focus ring placement and touch handling logic.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
On Android, a touchable that its own press disables (an
onPressInsettingdisabled) keeps the pressed ripple drawn, even after it's enabled again. TouchableRipple droppedandroid_rippleonce disabled, and only the ripple's own press out clears the native pressed state. It's now kept while disabled; a disabled view never presses, so it draws nothing.Related issue
Closes #5267. It comes from #5071.
Screenshots / Videos
Ripple
rgba(255, 0, 0, 0.5), after that press and re-enabling. Before, then after (in RTL with the dynamic theme):Test plan
On Android, press such a touchable, then enable it again: no tint is left. A disabled button still draws nothing when held.