File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
src/components/managers/products/genericProductComponent/sizesAndMeasurements Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -203,16 +203,24 @@ export const SizesAndMeasurements: FC<ProductSizesAndMeasurementsInterface> = ({
203
203
< Box display = 'flex' alignItems = 'center' >
204
204
< TextField
205
205
name = { `sizeMeasurements[${ sizeIndex } ].productSize.sizeId` }
206
- type = 'number '
206
+ type = 'text '
207
207
value = {
208
208
values . sizeMeasurements ?. [ sizeIndex ] ?. productSize ?. quantity ?. value === '0'
209
209
? ''
210
210
: values . sizeMeasurements ?. [ sizeIndex ] ?. productSize ?. quantity ?. value ||
211
211
''
212
212
}
213
- onChange = { ( e ) => handleSizeChange ( e , size . id ) }
213
+ onChange = { ( e ) => {
214
+ if ( e . target . value === '' || / ^ \d + $ / . test ( e . target . value ) ) {
215
+ handleSizeChange ( e , size . id ) ;
216
+ }
217
+ } }
214
218
onKeyDown = { restrictNumericInput }
215
- inputProps = { { min : 0 } }
219
+ inputProps = { {
220
+ min : 0 ,
221
+ inputMode : 'numeric' ,
222
+ pattern : '[0-9]*' ,
223
+ } }
216
224
style = { { width : '80px' } }
217
225
disabled = { disableFields || ( ! isLastSize && lastSizeNonZero ) }
218
226
/>
You can’t perform that action at this time.
0 commit comments