Skip to content

Commit 21eac79

Browse files
authored
Merge branch 'dev' into off-circle
2 parents ac3bff2 + 21ae4d5 commit 21eac79

4 files changed

Lines changed: 177 additions & 164 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).
1212

1313
## Fixed
1414
- [#3690](https://github.com/plotly/dash/pull/3690) Fixes Input when min or max is set to None
15+
- [#3723](https://github.com/plotly/dash/pull/3723) Fix misaligned `dcc.Slider` marks when some labels are empty strings
1516

1617
## [4.1.0] - 2026-03-23
1718

components/dash-core-components/src/components/css/sliders.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
.dash-slider-mark {
9393
position: absolute;
9494
font-size: 12px;
95+
height: 12px;
9596
line-height: 12px;
9697
color: var(--Dash-Text-Strong);
9798
white-space: nowrap;

components/dash-core-components/tests/integration/sliders/test_sliders.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -736,3 +736,30 @@ def update_rangeslider(value):
736736
dash_dcc.wait_for_text_to_equal("#rangeslider-output", "RangeSlider: 10-75")
737737

738738
assert dash_dcc.get_logs() == []
739+
740+
741+
def test_slsl020_empty_mark_labels_keep_tick_alignment(dash_dcc):
742+
app = Dash(__name__)
743+
marks = {val: (str(val) if val % 10 == 0 else "") for val in range(0, 151, 5)}
744+
745+
app.layout = dcc.Slider(
746+
id="slider-empty-mark-labels",
747+
min=0,
748+
max=150,
749+
step=None,
750+
value=0,
751+
marks=marks,
752+
)
753+
754+
dash_dcc.start_server(app)
755+
dash_dcc.wait_for_element("#slider-empty-mark-labels")
756+
757+
rendered_marks = dash_dcc.find_elements(
758+
"#slider-empty-mark-labels .dash-slider-mark"
759+
)
760+
labeled_mark = next(mark for mark in rendered_marks if mark.text)
761+
empty_mark = next(mark for mark in rendered_marks if not mark.text)
762+
763+
assert labeled_mark.size["height"] == 12
764+
assert empty_mark.size["height"] == labeled_mark.size["height"]
765+
assert dash_dcc.get_logs() == []

0 commit comments

Comments
 (0)