mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +00:00
fix(site): Confirm delete on press Enter in delete dialog (#7720)
This commit is contained in:
@ -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>
|
||||
</>
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user