@@ -90,45 +90,36 @@ export const NumberSelector = ({formInstance, fieldName, min, max, sharedValues,
9090 increment ( ) ;
9191 } ;
9292
93- const isEmpty = value === 0 ;
94- const buttonSize = selectorSize === 'compact'
95- ? ( isEmpty ? 30 : 26 )
96- : ( isEmpty ? 38 : 30 ) ;
97- const iconSize = selectorSize === 'compact'
98- ? ( isEmpty ? 14 : 13 )
99- : ( isEmpty ? 16 : 15 ) ;
93+ const buttonSize = selectorSize === 'compact' ? 26 : 30 ;
94+ const iconSize = selectorSize === 'compact' ? 13 : 15 ;
10095
10196 return (
102- < div className = { classNames ( classes . wrapper , 'button-input' , selectorSize === 'compact' && classes . compact ) }
103- data-empty = { value === 0 || undefined } >
104- { value > 0 && (
105- < >
106- < ActionIcon
107- size = { buttonSize }
108- radius = { 999 }
109- variant = { 'transparent' }
110- onClick = { decrement }
111- aria-label = { t `Decrease quantity` }
112- onMouseDown = { ( event ) => event . preventDefault ( ) }
113- className = { classNames ( classes . control , classes . decrement ) }
114- >
115- < IconMinus size = { iconSize } stroke = { 2 } />
116- </ ActionIcon >
117-
118- < NumberInput
119- mb = { 0 }
120- variant = "unstyled"
121- min = { minValue }
122- max = { maxValue }
123- handlersRef = { handlers }
124- value = { value }
125- hideControls
126- onChange = { ( newValue ) => changeValue ( Number ( newValue ) || 0 ) }
127- aria-label = { t `Quantity` }
128- classNames = { { input : classes . input } }
129- />
130- </ >
131- ) }
97+ < div className = { classNames ( classes . wrapper , 'button-input' , selectorSize === 'compact' && classes . compact ) } >
98+ < ActionIcon
99+ size = { buttonSize }
100+ radius = { 999 }
101+ variant = { 'transparent' }
102+ onClick = { decrement }
103+ disabled = { value === 0 }
104+ aria-label = { t `Decrease quantity` }
105+ onMouseDown = { ( event ) => event . preventDefault ( ) }
106+ className = { classNames ( classes . control , classes . decrement ) }
107+ >
108+ < IconMinus size = { iconSize } stroke = { 2 } />
109+ </ ActionIcon >
110+
111+ < NumberInput
112+ mb = { 0 }
113+ variant = "unstyled"
114+ min = { minValue }
115+ max = { maxValue }
116+ handlersRef = { handlers }
117+ value = { value }
118+ hideControls
119+ onChange = { ( newValue ) => changeValue ( Number ( newValue ) || 0 ) }
120+ aria-label = { t `Quantity` }
121+ classNames = { { input : classes . input } }
122+ />
132123
133124 < ActionIcon
134125 size = { buttonSize }
0 commit comments