Fix Dragging Issue on HsvColorPicker, AlphaSlider, and BrightnessSlider #29
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.
🎯 Goal
May be related to the Issue #25.
This PR fixes dragging gesture doesn't work properly on
HsvColorPicker
,AlphaSlider
, andBrightnessSlider
when its parent is scrollable.🛠 Implementation details
replaced
pointerInteropFilter
withpointerInput
.NOTE: There's code logic duplication in AlphaSlider and BrightnessSlider. So, these files should be refactored in some way...
✍️ Explain examples
This issue only happens when the parent is scrollable. To reproduce this issue, please test this example. (I'm using
Column
withverticalScroll
Modifier, but it can be aLazyColumn
.)Video
FYI
I came up with replacing pointer-input implementation because of this question on StackOverflow. (https://stackoverflow.com/questions/73676427/android-jetpack-compose-action-up-only-reached-for-tap-but-not-after-action-mov)
I love this library, and I'm using it in my personal project. I'm in trouble with this issue. Could you review my PR? 🙏🏻
Thank you.