@@ -5,7 +5,7 @@ import type { DSelectItem } from '@react-devui/ui/components/select';
5
5
import { isUndefined } from 'lodash' ;
6
6
import React , { useImperativeHandle , useState } from 'react' ;
7
7
8
- import { useAsync , useEventCallback , useId } from '@react-devui/hooks' ;
8
+ import { useAsync , useEventCallback } from '@react-devui/hooks' ;
9
9
import { FormControl , FormGroup , useForm , Validators } from '@react-devui/ui' ;
10
10
import { DForm , DInput , DModal , DSelect } from '@react-devui/ui' ;
11
11
@@ -21,9 +21,6 @@ function DeviceModal(props: AppDeviceModalProps, ref: React.ForwardedRef<OpenSet
21
21
const modelApi = useAPI ( '/device/model' ) ;
22
22
const async = useAsync ( ) ;
23
23
24
- const uniqueId = useId ( ) ;
25
- const id = `app-form-${ uniqueId } ` ;
26
-
27
24
const [ modelList , setModelList ] = useState < DSelectItem < string > [ ] > ( ) ;
28
25
29
26
const [ visible , setVisible ] = useState ( false ) ;
@@ -66,7 +63,7 @@ function DeviceModal(props: AppDeviceModalProps, ref: React.ForwardedRef<OpenSet
66
63
dHeader = { `${ device ? 'Edit' : 'Add' } Device` }
67
64
dFooter = {
68
65
< DModal . Footer
69
- dOkProps = { { type : 'submit' , form : id , disabled : ! form . valid } }
66
+ dOkProps = { { disabled : ! form . valid } }
70
67
onOkClick = { ( ) =>
71
68
new Promise ( ( r ) => {
72
69
async . setTimeout ( ( ) => {
@@ -82,7 +79,7 @@ function DeviceModal(props: AppDeviceModalProps, ref: React.ForwardedRef<OpenSet
82
79
setVisible ( false ) ;
83
80
} }
84
81
>
85
- < DForm id = { id } dUpdate = { updateForm } dLabelWidth = "6em" >
82
+ < DForm dUpdate = { updateForm } dLabelWidth = "6em" >
86
83
< DForm . Group dFormGroup = { form } >
87
84
< DForm . Item dFormControls = { { name : 'Please enter name!' } } dLabel = "Name" >
88
85
{ ( { name } ) => < DInput dFormControl = { name } dPlaceholder = "Name" /> }
0 commit comments