fix(site): Confirm delete on press Enter in delete dialog (#7720)

This commit is contained in:
Bruno Quaresma
2023-05-31 09:59:36 -03:00
committed by GitHub
parent be2067bb0d
commit b34894977d

View File

@ -41,6 +41,14 @@ export const DeleteDialog: FC<PropsWithChildren<DeleteDialogProps>> = ({
</Maybe>
<p>{t("deleteDialog.confirm", { entity })}</p>
<form
onSubmit={(e) => {
e.preventDefault()
if (confirmed) {
onConfirm()
}
}}
>
<TextField
fullWidth
autoFocus
@ -55,6 +63,7 @@ export const DeleteDialog: FC<PropsWithChildren<DeleteDialogProps>> = ({
error={hasError}
helperText={hasError && t("deleteDialog.incorrectName", { entity })}
/>
</form>
</>
)