File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -113,10 +113,6 @@ const AdvancedRangeControl = props => {
113113 let derivedValue = typeof props . value === 'undefined'
114114 ? value : props . value
115115
116- // Is value at first render the same as a step value? If so, do mark mode
117- // at the start, or show custom
118- // If no initial value, use the given default from the settings
119- const [ isMarkMode , setIsMarkMode ] = useState ( false )
120116 // Ensure the convesion of value from preset to custom with regards to the unit is donce once.
121117 const isConversionDone = useRef ( false )
122118
@@ -132,6 +128,11 @@ const AdvancedRangeControl = props => {
132128 }
133129 }
134130
131+ // Is value at first render the same as a step value? If so, do mark mode
132+ // at the start, or show custom
133+ // If no initial value, use the given default from the settings
134+ const [ isMarkMode , setIsMarkMode ] = useState ( isMarkValue )
135+
135136 // Set the markMode when device type changes
136137 useEffect ( ( ) => {
137138 setIsMarkMode ( isMarkValue )
Original file line number Diff line number Diff line change @@ -189,7 +189,6 @@ const FourRangeControl = memo( props => {
189189 : props . enableBottom ? { desktop : _valueDesktop ?. bottom , tablet : _valueTablet ?. bottom }
190190 : { desktop : _valueDesktop ?. left , tablet : _valueTablet ?. left }
191191
192- const [ isFourMarkMode , setIsFourMarkMode ] = useState ( false )
193192 // Ensure the convesion of value from preset to custom with regards to the unit is donce once.
194193 const isConversionDone = useRef ( {
195194 first : false ,
@@ -232,6 +231,8 @@ const FourRangeControl = memo( props => {
232231 } )
233232 }
234233
234+ const [ isFourMarkMode , setIsFourMarkMode ] = useState ( isMarkValue )
235+
235236 // Set the markMode when device type changes
236237 useEffect ( ( ) => {
237238 setIsFourMarkMode ( isMarkValue )
You can’t perform that action at this time.
0 commit comments