Skip to content

Commit 0d6e5fa

Browse files
committed
fix: removing of unit picker according to four range mode
1 parent d0b7cba commit 0d6e5fa

File tree

1 file changed

+12
-1
lines changed
  • src/components/four-range-control

1 file changed

+12
-1
lines changed

src/components/four-range-control/index.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,6 @@ const FourRangeControl = memo( props => {
305305

306306
// Other necessary props for steps.
307307
newProps.withInputField = false
308-
controlProps.units = false
309308
} else {
310309
newProps.marks = undefined
311310
}
@@ -347,6 +346,18 @@ const FourRangeControl = memo( props => {
347346
]
348347
}
349348

349+
// Remove the unit picker if not in mark mode for every four range mode
350+
if ( isLocked && ! props.vhMode ) {
351+
controlProps.units = isFourMarkMode.first
352+
? false : controlProps.units
353+
} else if ( isLocked && props.vhMode ) {
354+
controlProps.units = isFourMarkMode.top && isFourMarkMode.left
355+
? false : controlProps.units
356+
} else {
357+
controlProps.units = isFourMarkMode.top && isFourMarkMode.right && isFourMarkMode.bottom && isFourMarkMode.left
358+
? false : controlProps.units
359+
}
360+
350361
// Create step supports for each side
351362
const [ propsToPassFirst, rangeValueFirst, rangeOnChangeFirst ] = stepSupport(
352363
isFourMarkMode.first,

0 commit comments

Comments
 (0)