plotly / plotly/plotly.js

Scrolling on the legend will cause the parent to scroll

Offen
#7,066 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

bug P2 sev-3
Vorherrschende Sprache
JavaScript
Sterne
18.3k
Forks
2k
Ø Merge
2 T. 12 Std.
Gemergte PRs (30 T.)
28

Beschreibung

When I scroll in the legend, the whole page scrolls as long as the legend is at the top or bottom. This seems to be normal, but the problem is that it scrolls so fast that it quickly reaches the top or bottom and scrolls the whole page.

I found out it was a bug in the source code makes the scroll so fast, which I checked and fixed with PR #7067 (I'm not sure if my fix is correct, but the scrolling behavior got much better.

The current legend scroll behavior with Plotly v2.34.0:
it reaches the bottom or top quickly and make the page scroll!
recording

Note that I'm using Windows 10 with lines to scroll set to 10 each time, but I think 10 isn't that high:
image

After my fix in the source code, scrolling becomes normal with lines to scroll set to 10:
recording

And even normal if the value for the lines to be scrolled is set to 1:
image

recording

P.S. In the PR #7067, I would prefer the page to stop scrolling at the top or bottom of the legend as well, since the original behavior scrolls the page immediately when it reaches the top or bottom, as opposed to the native browser behavior where you have to scroll again to scroll the parent.

P.S. The touch event also seems to have a problem, when touch dragging the legend the whole page moves.
But in the PR #7067 for solving this issue, I only focus on the wheel scroll event.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit der Prüfung von PR #7067 und der Behandlung von legend wheel-scroll in Plotly v2.34.0. Reproduziere das Problem mit den beschriebenen Windows-Radeinstellungen und vergleiche anschließend das Radverhalten an den Grenzen der Legende. Erledigt ist die Aufgabe, wenn das Scrollen der Legende die Seite nicht mehr unerwartet bewegt; das Touch-Verhalten wird separat betrachtet.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
javascript
Bereich
data-visualization
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.