mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-21 11:45:59 +00:00
submit action - run with enter
This commit is contained in:
@@ -106,7 +106,10 @@ export function FormSelectField({ label, name, children = null, ...other }) {
|
||||
}
|
||||
|
||||
export function FormSubmit({ onClick, value, ...other }) {
|
||||
const { values } = useForm();
|
||||
const { values, setSubmitAction } = useForm();
|
||||
React.useEffect(() => {
|
||||
setSubmitAction({ action: onClick });
|
||||
}, [onClick]);
|
||||
return <FormStyledButton type="submit" value={value} onClick={() => onClick(values)} {...other} />;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user