Do not disable scrollZoom scroll{Width,Height} > client{Width,Height}#3424
Merged
Do not disable scrollZoom scroll{Width,Height} > client{Width,Height}#3424
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).
Contributor
Author
|
@antoinerg would you mind taking a look at this one at some point this week? |
Contributor
Author
|
Oh wait. I still have to add a few tests for this one. Asking for @alexcjohnson 's opinion on this potentially-controversial patch. |
Collaborator
|
Agreed. Explicit is better than implicit. |
Contributor
Author
@antoinerg I know you're busy, but would you mind taking a 👁️ at this PR at some point this week (should be quick 😉 ) |
antoinerg
reviewed
Jan 15, 2019
| if(pc.scrollHeight - pc.clientHeight > 10 || | ||
| pc.scrollWidth - pc.clientWidth > 10) { | ||
| return; | ||
| } |
Contributor
There was a problem hiding this comment.
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...
Contributor
|
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 💃 |
This file contains hidden or 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
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.
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 heightvhunits doesn't work, as in that scenariogd.client{Width,Height}is0leading 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: trueuser config is a good idea.I hope @plotly/plotly_js agrees. If so, I'll add a few tests.