File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -116,7 +116,8 @@ const AdvancedRangeControl = props => {
116116 if ( props . marks && derivedValue ) {
117117 // Check if the current value exists in the marks only by their CSS variable name
118118 // to match in case the fallback size changes.
119- const matchedMark = props . marks . find ( mark => getCSSVarName ( mark . value ) === getCSSVarName ( derivedValue ) )
119+ const derivedValueCssVarName = getCSSVarName ( derivedValue )
120+ const matchedMark = props . marks . find ( mark => getCSSVarName ( mark . value ) === derivedValueCssVarName )
120121 isMarkValue = ! ! matchedMark
121122 if ( matchedMark ) {
122123 derivedValue = matchedMark . value
Original file line number Diff line number Diff line change @@ -200,14 +200,16 @@ const FourRangeControl = memo( props => {
200200 if ( props . marks && firstValue ) {
201201 // Check if the current value exists in the marks only by their CSS variable name
202202 // to match in case the fallback size changes.
203- const firstMatchedMark = props . marks . find ( mark => getCSSVarName ( mark . value ) === getCSSVarName ( firstValue ) )
203+ const firstValueCssVarName = getCSSVarName ( firstValue )
204+ const firstMatchedMark = props . marks . find ( mark => getCSSVarName ( mark . value ) === firstValueCssVarName )
204205 isMarkValue . first = ! ! firstMatchedMark
205206 if ( firstMatchedMark ) {
206207 firstValue = firstMatchedMark . value
207208 }
208209
209210 [ 'top' , 'right' , 'bottom' , 'left' ] . forEach ( side => {
210- const matchedMark = props . marks . find ( mark => getCSSVarName ( mark . value ) === getCSSVarName ( value [ side ] ) )
211+ const sideCssVarName = getCSSVarName ( value [ side ] )
212+ const matchedMark = props . marks . find ( mark => getCSSVarName ( mark . value ) === sideCssVarName )
211213 isMarkValue [ side ] = ! ! matchedMark
212214 if ( matchedMark ) {
213215 value [ side ] = matchedMark . value
You can’t perform that action at this time.
0 commit comments