[BUG] `dcc.RangeSlider` ignores `allowCross=False` and lets handles cross
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 48/100
Rechercherichtung
Beginne mit der Implementierung von dcc.RangeSlider und reproduziere das minimale Beispiel mit allowCross=False. Verfolge Zeiger-, Tastatur-, Home/End- und Direkteingabe-Interaktionen unter beiden updatemodes und finde für jeden Pfad vorhandene Testabdeckung oder füge sie hinzu. Erledigt ist die Aufgabe, wenn sich die Griffe nicht überschneiden können und das Beispiel sowohl für value als auch für drag_value [15, 15] meldet.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Context
dash 4.4.1 (editable source checkout)
- Reproduced at commit:
3d3a9f70f452fba4dc385db94590009ce44031fc - OS: Ubuntu 24.04.4 LTS
- Browser: Google Chrome 151.0.7922.71
The bug
dcc.RangeSlider does not enforce allowCross=False. When the lower thumb is
dragged past the upper thumb, the dragged thumb crosses it and becomes the new
upper thumb.
For example, a slider starting at [5, 15] ends at [15, 18] after its lower
thumb is dragged toward 18. The returned array is still sorted, but the thumb
identity and resulting interval prove that crossing occurred despite being
explicitly disabled. Application callbacks therefore cannot rely on the
allowCross=False constraint.
Minimal reproducible example
from dash import Dash, Input, Output, dcc, html
app = Dash(__name__)
app.layout = html.Div(
style={"margin": "80px auto", "width": "500px"},
children=[
dcc.RangeSlider(
id="range-slider",
min=0,
max=20,
step=1,
value=[5, 15],
allowCross=False,
updatemode="drag",
tooltip={"always_visible": True},
),
html.Pre(id="range-output", style={"marginTop": "40px"}),
],
)
@app.callback(
Output("range-output", "children"),
Input("range-slider", "value"),
Input("range-slider", "drag_value"),
)
def show_values(value, drag_value):
return f"value={value}\ndrag_value={drag_value}"
if __name__ == "__main__":
app.run()
Steps to reproduce
- Run the example and open http://127.0.0.1:8050.
- Drag the lower handle from
5past the upper handle at15, toward18. - Observe that the dragged thumb passes the other thumb and the callback
reportsvalue=[15, 18]anddrag_value=[15, 18].
Expected behavior
With allowCross=False, a handle should stop when it reaches its neighboring
handle. In the example above, dragging the lower handle toward 18 should
clamp both handles at 15, producing:
value=[15, 15]
drag_value=[15, 15]
The same no-cross constraint should apply to pointer, keyboard, Home/End, and
direct-input interactions, with both updatemode="drag" and
updatemode="mouseup".
Screenshots
The bug at commit 3d3a9f70f;
- Vorherrschende Sprache
- Python
- Sterne
- 24.4k
- Forks
- 2.3k
- Ø Merge
- 2 T. 1 Std.
- Gemergte PRs (30 T.)
- 19
Entwicklungsumgebung
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus plotly/dash
-
good first issue P3 size: 1 task
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
plotly/dash#3735 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 68/100
Maintainer antworten meist innerhalb von 1 Tag
-
Shared-storage topics are never freed: streaming leaks ~32 frames per page loadEvtl. vergeben @T4rk1n hat das vor 1 Tag übernommen. Offenbug P1 size: 3
plotly/dash#4010 · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
[BUG] disable autocomplete in the date pickers inputEvtl. vergeben @AnnMarieW hat das vor 1 Tag übernommen. Offenbug P2 size: 1
plotly/dash#4009 · 1 Kommentar · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
P1 size: 1
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 65/100
plotly/dash#4008 · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
gradio-app/gradio#13895 ·
Maintainer antworten meist innerhalb von 1 Tag
-
build-error
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
spack/spack-packages#6713 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Use issue templatesOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
ActivityWatch/activitywatch#1464 · 1 Reaktion ·
Maintainer antworten meist innerhalb von 1 Tag
-
[Bug]: The ckg tool drops the return type of every decorated Python method in class search resultsOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
bytedance/trae-agent#483 ·
Maintainer antworten meist innerhalb von 1 Tag