File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ export default function Steps(props: StepsProps) {
2424 } ) ;
2525
2626 // Fill dots
27- if ( dots ) {
27+ if ( dots && step !== null ) {
2828 let current = min ;
2929 while ( current <= max ) {
3030 dotSet . add ( current ) ;
Original file line number Diff line number Diff line change @@ -51,6 +51,11 @@ describe('Common', () => {
5151 expect ( container2 . getElementsByClassName ( 'rc-slider-dot-active' ) ) . toHaveLength ( 4 ) ;
5252 } ) ;
5353
54+ it ( 'should render normally when `dots=true` and `step=null`' , ( ) => {
55+ const { container } = render ( < Slider step = { null } dots /> ) ;
56+ expect ( ( ) => container ) . not . toThrowError ( ) ;
57+ } ) ;
58+
5459 it ( 'should render dots correctly when dotStyle is dynamic`' , ( ) => {
5560 const { container : container1 } = render (
5661 < Slider value = { 50 } step = { 10 } dots dotStyle = { ( dotValue ) => ( { width : `${ dotValue } px` } ) } /> ,
You can’t perform that action at this time.
0 commit comments