dbuezas/lovelace-plotly-graph-card

Zooming behavior - graph zooms when it slides under the mouse pointer while scrolling a page

wixoff opened this issue ยท 4 comments

Describe the bug
On my Linux/Gnome laptop using Firefox, I ordinarily scroll the page using two fingers up/down on my trackpad. In doing so, if a plotly graph card happens to arrive under my mouse pointer, the page will stop scrolling and the graph will zoom in or out instead. In the middle of a page-scrolling attempt this is usually undesired.

If it's possible, consider zooming the graph ONLY when a gesture begins over the card.

Hi ๐Ÿ‘‹
This is actually the intended behaviour, and also the way it works in my mac.
In desktop, this is handled by plotly itself, on mobile this card takes care of it (because plotly doesn't have "native" multi touch mobile support).
I can't reproduce the behaviour you are describing, could you record a video where I can see both the touchpad and the screen at the same time? maybe that way I can code a workaround for however it is that linux+firefox handle this.

Oh that's interesting, this seems to be a Firefox issue -- Chrome doesn't have the problem.

I have used Firefox for decades and I do prefer it . . . but it sure does test me sometimes! Let me see if I can figure out any more background info.

btw, you can always disable scroll to zoom if this is getting in your way:

config:
  scrollZoom: false # this is a "native" plotly option
disable_pinch_to_zoom: true # this is specific to this card and meant for touchscreens only but I don't know how firefox handles touchpads. It also disables two finger drag to zoom on touchscreens 

OK, I think I'll close this. scrollZoom: false works well enough for me, since I have the zoom buttons available anyway.

Thanks for looking into this!