File tree Expand file tree Collapse file tree 3 files changed +29
-0
lines changed
components/dash-core-components
tests/integration/sliders Expand file tree Collapse file tree 3 files changed +29
-0
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 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;
Original file line number Diff line number Diff line change @@ -734,3 +734,30 @@ def update_rangeslider(value):
734734 dash_dcc .wait_for_text_to_equal ("#rangeslider-output" , "RangeSlider: 10-75" )
735735
736736 assert dash_dcc .get_logs () == []
737+
738+
739+ def test_slsl020_empty_mark_labels_keep_tick_alignment (dash_dcc ):
740+ app = Dash (__name__ )
741+ marks = {val : (str (val ) if val % 10 == 0 else "" ) for val in range (0 , 151 , 5 )}
742+
743+ app .layout = dcc .Slider (
744+ id = "slider-empty-mark-labels" ,
745+ min = 0 ,
746+ max = 150 ,
747+ step = None ,
748+ value = 0 ,
749+ marks = marks ,
750+ )
751+
752+ dash_dcc .start_server (app )
753+ dash_dcc .wait_for_element ("#slider-empty-mark-labels" )
754+
755+ rendered_marks = dash_dcc .find_elements (
756+ "#slider-empty-mark-labels .dash-slider-mark"
757+ )
758+ labeled_mark = next (mark for mark in rendered_marks if mark .text )
759+ empty_mark = next (mark for mark in rendered_marks if not mark .text )
760+
761+ assert labeled_mark .size ["height" ] == 12
762+ assert empty_mark .size ["height" ] == labeled_mark .size ["height" ]
763+ assert dash_dcc .get_logs () == []
You can’t perform that action at this time.
0 commit comments