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
refactor(range): update value on touchEnd or drag #29005
Merged
Conversation
This file contains 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
thetaPC
requested review from
amandaejohnston
and removed request for
a team
February 15, 2024 18:42
amandaejohnston
suggested changes
Feb 16, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work on this! I tested the behavior against my findings in #28487 (comment) and everything looks great. Just noticed a thing with the events.
amandaejohnston
approved these changes
Mar 6, 2024
3 tasks
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.
Issue number: resolves #28487
What is the current behavior?
There are two behaviors that need to be addressed.
The range value is updated when the gesture
onStart
event is fired.This can lead to the values being accidentally updated when the user is scrolling on the view.
The user might tap on the range to scroll on the view, but the range value is updated instead.
The component prevents the view from scrolling while the user has touched any part of the range.
The user might want to scroll and they happen to touch the range. This can lead to the user feeling disoriented because they can't scroll on the view anymore.
These behaviors do not follow the native behavior of mobile devices.
What is the new behavior?
isScrollingView
is used to determine if the user is scrolling on the view regardless of whether the user is dragging the knob or not. This determines what logic to apply.pressedKnob
variable is no longer being set in theonStart
event. It is now being set in theonMove
andonEnd
events. (the reason behind this can be found within the newly added comments)initialContentScrollY
variable is no longer being set in theonStart
event. It is now being set in theonMove
event. (the reason behind this can be found within the newly added comments)I did not change the behavior of the range when the user is dragging the knob. The view should not scroll while the user is dragging the knob.
Does this introduce a breaking change?
Other information
The new behavior aligns with the native mobile devices.