File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
components/SchemaForm/components Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -73,12 +73,16 @@ const Index: FC<Props> = ({
7373 }
7474 } ;
7575
76+ // For number type, use ?? to preserve 0 value; for other types, use || for backward compatibility
77+ const inputValue =
78+ type === 'number' ? ( fieldObject ?. value ?? '' ) : fieldObject ?. value || '' ;
79+
7680 return (
7781 < Form . Control
7882 name = { fieldName }
7983 placeholder = { placeholder }
8084 type = { type }
81- value = { fieldObject ?. value || '' }
85+ value = { inputValue }
8286 { ...numberInputProps }
8387 inputMode = { inputMode }
8488 onChange = { handleChange }
Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ const QaSettings = () => {
4949 type : 'number' ,
5050 title : t ( 'min_tags.label' ) ,
5151 description : t ( 'min_tags.text' ) ,
52+ default : 0 ,
5253 } ,
5354 min_content : {
5455 type : 'number' ,
@@ -124,6 +125,7 @@ const QaSettings = () => {
124125 formMeta . min_tags . value = res . min_tags ;
125126 formMeta . min_content . value = res . min_content ;
126127 formMeta . restrict_answer . value = res . restrict_answer ;
128+ console . log ( 'res' , res , formMeta ) ;
127129 setFormData ( formMeta ) ;
128130 }
129131 } ) ;
You can’t perform that action at this time.
0 commit comments