-
Notifications
You must be signed in to change notification settings - Fork 399
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
[Switch] The dragEnd()
function needs to make sure the switch is in an allowed position
#54
Comments
Try it on an actual device. The movement you make is exactly correct and repros the behavior. |
which device you on? works great on my devices and emulators. screen-20210816-082445.mp4 |
This is on iOS 15 (with the funny Safari bottom URL bar, which might be interfering when it comes to scroll and drag handling?) on an iPhone 11 Max Pro. |
looks like an iOS bug that if the user begins the drag with vertical movement, the page is scrolled and then the pointerup event (or move events) are never fired. the beginning of the gif shows the desired ux but is also beginning the swipe horizontally. the end of the gif, showing the undesired ux, is when the drag event is competing with page scroll. i think there's a lot of complex stuff happening here with touch-action, page scroll and pointer events and iOS is prioritizing the page scroll over the pointer events? i'm not sure how to fix this other than preventing document scroll when the gesture has begun from inside one of these switches. maybe touch-action can help more here, cuz it's already preventing page horizontal scroll when panning the thumb (ipad was the main offender of horizontal page scroll competing with horizontal drag of the thumb). have ideas? did i isolate the bug in the above gif? |
Yeah, it looks like preventing scrolling could help improve the situation. It’s indeed pretty complex to debug what’s going on. |
The
dragEnd()
function, triggered bypointerup
, needs to make sure the switch is in an allowed position. Currently it is possible to drag the switch, then without releasing the finger drag outside of the switch so that the switch is in an "in-between" visual state, and then release the finger.gui-challenges/switch/index.js
Line 37 in fd7753b
The text was updated successfully, but these errors were encountered: