-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Do not disable scrollZoom scroll{Width,Height} > client{Width,Height} #3424
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
Conversation
Used to disable scrollzoom when the plot had scrollbars. Ended up with a plot which is not zoomable with mouse scroll on a page which had additional content (had a scrollbar).
@antoinerg would you mind taking a look at this one at some point this week? |
Oh wait. I still have to add a few tests for this one. Asking for @alexcjohnson 's opinion on this potentially-controversial patch. |
Agreed. Explicit is better than implicit. |
@antoinerg I know you're busy, but would you mind taking a 👁️ at this PR at some point this week (should be quick 😉 ) |
if(pc.scrollHeight - pc.clientHeight > 10 || | ||
pc.scrollWidth - pc.clientWidth > 10) { | ||
return; | ||
} |
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.
I am not sure what this early return was meant to achieve but I guess it's OK to 🔪 considering it doesn't have any associated tests...
Thank you for the fix @etpinard! It seems to work well: https://codepen.io/anon/pen/roRdmB If the removed code really is a relic, then 💃 |
fixes #2371 and #3337 by including a commit from @marfoldi's #3085.
Removing the
scroll{Width,Height} > client{Width,Height}
early return fixes two bugs:{responsive: true, scrollZoom: true}
+ graph div heightvh
units doesn't work, as in that scenariogd.client{Width,Height}
is0
leading to an early return.There are probably other ways to fix these bugs, but that
scroll{Width,Height} > client{Width,Height}
early return feels out-of-place. It's probably a relic from the workspace days, where we setscrollZoom:true
, but wanted some extra do-not-scroll logic. As scroll zoom is disable by default for cartesian subplots, I don't think overriding ascrollZoom: true
user config is a good idea.I hope @plotly/plotly_js agrees. If so, I'll add a few tests.