-
Notifications
You must be signed in to change notification settings - Fork 23
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
Fix dropdown scroll problem on touch devices #2396
Fix dropdown scroll problem on touch devices #2396
Conversation
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.
Nice fix, I have proposed a minor refactor. Let me know what you think.
onTouchStart(event: TouchEvent): void { | ||
// Prevent touchmove propgation to allow for scroll on page with pull-to-refresh; | ||
event.stopPropagation(); | ||
} |
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.
Consider replacing this with the following snippet.
I think it should result in identical behavior, and it uses a similar pattern to how we have done it for the keydown events in this component (bottom of this file). As an added bonus we should not need to add anything to the template.
@HostListener('touchstart', ['$event']) _onTouchStart(event: TouchEvent) {
event.stopPropagation();
}
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.
Fixed
c6e8346
to
0d5f9c6
Compare
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.
Very nice 👍
…pout-list-on-native-devices-with-pull-to-refresh
Which issue does this PR close?
This PR closes #2335
What is the new behavior?
Prevent page refresh when dropdown is scrolled on touch devices
Does this PR introduce a breaking change?
Are there any additional context?
Checklist:
The following tasks should be carried out in sequence in order to follow the process of contributing correctly.
Reminders
Review
When the pull request has been approved it will be merged to
develop
by Team Kirby.