A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.
fix(ui): Fixed the problem that select cannot be selected
robin9caddd22b315
diff --git a/ui/src/components/SchemaForm/index.tsx b/ui/src/components/SchemaForm/index.tsxindex e29be8e8..776d0b42 100644--- a/ui/src/components/SchemaForm/index.tsx+++ b/ui/src/components/SchemaForm/index.tsx@@ -109,6 +109,17 @@ const SchemaForm: FC<IProps> = ({}};+ const handleSelectChange = (e: React.ChangeEvent<HTMLSelectElement>) => {+ const { name, value } = e.target;+ const data = {+ ...formData,+ [name]: { ...formData[name], value, isInvalid: false },+ };+ if (onChange instanceof Function) {+ onChange(data);+ }+ };+const handleSwitchChange = (e: React.ChangeEvent<HTMLInputElement>) => {const { name, checked } = e.target;const data = {@@ -238,6 +249,9 @@ const SchemaForm: FC<IProps> = ({<Form.Label>{title}</Form.Label><Form.Selectaria-label={description}+ name={key}+ value={formData[key]?.value}+ onChange={handleSelectChange}isInvalid={formData[key].isInvalid}>{properties[key].enum?.map((item, index) => {return (@@ -314,7 +328,8 @@ const SchemaForm: FC<IProps> = ({<Form.Label>{title}</Form.Label><TimeZonePickervalue={formData[key]?.value}- onChange={handleInputChange}+ name={key}+ onChange={handleSelectChange}/><Form.Controlname={key}