File tree 1 file changed +6
-1
lines changed
src/lib/components/preferences/items 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ const useStyles = makeStyles(({ spacing }: Theme) => ({
27
27
const ImagePadding : React . FC < InputProps > = ( props ) => {
28
28
const classes = useStyles ( )
29
29
const values = ( props . value as string ) . split ( ' ' ) ?? [ ]
30
+ const initialValues = React . useRef < Array < string > > ( values ) . current
30
31
const handleChange = ( index : number ) => ( value : any = '0px' ) => {
31
32
const newValues = [ ...values ]
32
33
newValues [ index ] = value
@@ -43,7 +44,11 @@ const ImagePadding: React.FC<InputProps> = (props) => {
43
44
props . onChange ( '0px' )
44
45
break
45
46
default :
46
- props . onChange ( '0px 0px 0px 0px' )
47
+ if ( initialValues . length > 1 ) {
48
+ props . onChange ( initialValues . join ( ' ' ) )
49
+ } else {
50
+ props . onChange ( '0px 0px 0px 0px' )
51
+ }
47
52
}
48
53
}
49
54
return (
You can’t perform that action at this time.
0 commit comments