File tree 1 file changed +23
-14
lines changed
site/src/components/Dialogs/DeleteDialog
1 file changed +23
-14
lines changed Original file line number Diff line number Diff line change @@ -41,20 +41,29 @@ export const DeleteDialog: FC<PropsWithChildren<DeleteDialogProps>> = ({
41
41
</ Maybe >
42
42
< p > { t ( "deleteDialog.confirm" , { entity } ) } </ p >
43
43
44
- < TextField
45
- fullWidth
46
- autoFocus
47
- className = { styles . textField }
48
- name = "confirmation"
49
- autoComplete = "off"
50
- id = "confirmation"
51
- placeholder = { name }
52
- value = { nameValue }
53
- onChange = { handleChange }
54
- label = { t ( "deleteDialog.confirmLabel" , { entity } ) }
55
- error = { hasError }
56
- helperText = { hasError && t ( "deleteDialog.incorrectName" , { entity } ) }
57
- />
44
+ < form
45
+ onSubmit = { ( e ) => {
46
+ e . preventDefault ( )
47
+ if ( confirmed ) {
48
+ onConfirm ( )
49
+ }
50
+ } }
51
+ >
52
+ < TextField
53
+ fullWidth
54
+ autoFocus
55
+ className = { styles . textField }
56
+ name = "confirmation"
57
+ autoComplete = "off"
58
+ id = "confirmation"
59
+ placeholder = { name }
60
+ value = { nameValue }
61
+ onChange = { handleChange }
62
+ label = { t ( "deleteDialog.confirmLabel" , { entity } ) }
63
+ error = { hasError }
64
+ helperText = { hasError && t ( "deleteDialog.incorrectName" , { entity } ) }
65
+ />
66
+ </ form >
58
67
</ >
59
68
)
60
69
You can’t perform that action at this time.
0 commit comments