[BUG] `dcc.RangeSlider` ignores `allowCross=False` and lets handles cross
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
Línea de trabajo
Comienza con la implementación de dcc.RangeSlider y reproduce el ejemplo mínimo con allowCross=False. Rastrea las interacciones con el puntero, el teclado, Home/End y la entrada directa con ambos updatemodes, y localiza o añade cobertura para cada ruta. Se considera terminado cuando los controles no pueden cruzarse y el ejemplo muestra [15, 15] tanto para value como para drag_value.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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;
- Lenguaje dominante
- Python
- Estrellas
- 24.4k
- Forks
- 2.3k
- Merge medio
- 2 d 7 h
- PR fusionados (30 d)
- 13
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de plotly/dash
-
good first issue P3 size: 1 task
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
enhancement P3 size: 10+
-
P2 size: 1 task
-
enhancement P3 size: 1
Dificultad 3/5 1-2 días Aptitud para principiantes 72/100
-
bug P2 size: 5
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
Todos los issues de plotly/dash
Issues similares
-
link-check link-check:sphinx-theme
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
qgis/QGIS-Documentation#11275 ·
-
bug priority:normal ready-for-dev
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
OpenHands/extensions#626 · 1 comentario ·
-
Change observation tooltip text Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
CSCfi/sd-search-api#39 ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100