-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Issue 3801 - legend scrolling on mobile #3873
Issue 3801 - legend scrolling on mobile #3873
Conversation
1fa41a5
to
e155a8b
Compare
Thanks very much for this PR! Legend scroll on touch works fine in https://codepen.io/anon/pen/yWggJM for me (tested on mobile FF 66) Now, it seems that we can no longer scroll the page on touch, like if the legend touch handlers took over the whole page. I'm sure why that is, can anyone else check by trying to scroll by touching in the graph's left margin? |
Hi, no problem, we love Plotly! I should have mentioned that in the fixed Codepen, in the CSS section I set Another possible issue - a coworker pointed out that touch-dragging the legend: going in for a second touch to continue scrolling can cause the legend to jump... I was going to look at that today. |
e155a8b
to
26ea3bc
Compare
My coworker was right (going in for a second touch to continue scrolling can cause the legend to jump), I was mistakenly inverting the initial touch when there was no need. I have force-pushed this change to fix it: The 'working' codepen has been updated: https://codepen.io/anon/pen/yWggJM Now I think this PR is ready for review, thanks very much. |
👍 This works great! |
Thanks @oshikryu! However I was still a bit optimistic, I could still see a little jump sometimes. With the last commit above, the math is finally correct for the natural scrolling, and I can no longer reproduce the jump. Working codepen also updated for this change. Thanks @etpinard for your patience, I’m done now. I didn’t squash this last commit so you could see the evolution more easily, let me know if you’d like me to. |
Thanks @andrewbaldock @oshikryu The behavior off 53fa7f3 feels good to me. Now, would you be interested in writing a test similar to plotly.js/test/jasmine/tests/legend_scroll_test.js Lines 152 to 160 in 53fa7f3
but for touch drag? Using our touchEvent wrapper and looking at how the select suite emulates touch should help you get started. |
Will do! Just got buried at work, I will try to get it to you by early next week. |
https://codepen.io/anon/pen/yWggJM Seems to cause double scrolling (legend and page), when touch scrolling the legend? |
@dan8f |
@andrewbaldock thanks for your reply! We should able to take this from here. We're planning on making a few legend improvements before releasing Thanks again! |
Looks like I can't push commits to this branch. So I'll merge this PR now and attempt to add a test on a branch up-to-date with the latest legend work. |
Potential fix for issue #3801
scrollbar
drag listener so it scrolls when dragged via mouse or touchscrollbox
touch listener so the box natural-scrolls when legend is dragged via touchNot working example, from issue 3801:
https://codepen.io/anon/pen/MRqOgE
Working example:
https://codepen.io/anon/pen/yWggJM