Skip to content

Commit 5b4f3c4

Browse files
committed
chore(platform): remove submit type of ok button
1 parent 1cfd29a commit 5b4f3c4

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

packages/platform/src/app/routes/list/standard-table/DeviceModal.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type { DSelectItem } from '@react-devui/ui/components/select';
55
import { isUndefined } from 'lodash';
66
import React, { useImperativeHandle, useState } from 'react';
77

8-
import { useAsync, useEventCallback, useId } from '@react-devui/hooks';
8+
import { useAsync, useEventCallback } from '@react-devui/hooks';
99
import { FormControl, FormGroup, useForm, Validators } from '@react-devui/ui';
1010
import { DForm, DInput, DModal, DSelect } from '@react-devui/ui';
1111

@@ -21,9 +21,6 @@ function DeviceModal(props: AppDeviceModalProps, ref: React.ForwardedRef<OpenSet
2121
const modelApi = useAPI('/device/model');
2222
const async = useAsync();
2323

24-
const uniqueId = useId();
25-
const id = `app-form-${uniqueId}`;
26-
2724
const [modelList, setModelList] = useState<DSelectItem<string>[]>();
2825

2926
const [visible, setVisible] = useState(false);
@@ -66,7 +63,7 @@ function DeviceModal(props: AppDeviceModalProps, ref: React.ForwardedRef<OpenSet
6663
dHeader={`${device ? 'Edit' : 'Add'} Device`}
6764
dFooter={
6865
<DModal.Footer
69-
dOkProps={{ type: 'submit', form: id, disabled: !form.valid }}
66+
dOkProps={{ disabled: !form.valid }}
7067
onOkClick={() =>
7168
new Promise((r) => {
7269
async.setTimeout(() => {
@@ -82,7 +79,7 @@ function DeviceModal(props: AppDeviceModalProps, ref: React.ForwardedRef<OpenSet
8279
setVisible(false);
8380
}}
8481
>
85-
<DForm id={id} dUpdate={updateForm} dLabelWidth="6em">
82+
<DForm dUpdate={updateForm} dLabelWidth="6em">
8683
<DForm.Group dFormGroup={form}>
8784
<DForm.Item dFormControls={{ name: 'Please enter name!' }} dLabel="Name">
8885
{({ name }) => <DInput dFormControl={name} dPlaceholder="Name" />}

0 commit comments

Comments
 (0)