Skip to content

Commit a152e8a

Browse files
committed
fix: correct handling of nested forms
1 parent 1ca4924 commit a152e8a

File tree

5 files changed

+8
-5
lines changed

5 files changed

+8
-5
lines changed

src/plugins/core/PropertyPopover.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ export const PropertyPopover: React.FC<PropertyPopoverProps> = ({ title, propert
4545
onSubmit={(e) => {
4646
void handleSubmit(onChange)(e)
4747
setOpen(false)
48-
e.nativeEvent.stopImmediatePropagation()
48+
e.preventDefault()
49+
e.stopPropagation()
4950
}}
5051
>
5152
<h3 className={styles.propertyPanelTitle}>{title} Attributes</h3>

src/plugins/frontmatter/FrontmatterEditor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export const FrontmatterEditor = ({ yaml, onChange }: FrontmatterEditorProps) =>
6868
<form
6969
onSubmit={(e) => {
7070
void handleSubmit(onSubmit)(e)
71-
e.nativeEvent.stopImmediatePropagation()
71+
e.stopPropagation()
7272
}}
7373
onReset={() => setFrontmatterDialogOpen(false)}
7474
>

src/plugins/image/ImageDialog.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ export const ImageDialog: React.FC = () => {
4747
onSubmit={(e) => {
4848
void handleSubmit(saveImage)(e)
4949
reset({ src: '', title: '', altText: '' })
50-
e.nativeEvent.stopImmediatePropagation()
50+
e.preventDefault()
51+
e.stopPropagation()
5152
}}
5253
className={styles.multiFieldForm}
5354
>

src/plugins/link-dialog/LinkDialog.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ export function LinkEditForm({ url, title, onSubmit, onCancel, linkAutocompleteS
5151
<form
5252
onSubmit={(e) => {
5353
void handleSubmit(onSubmit)(e)
54-
e.nativeEvent.stopImmediatePropagation()
54+
e.stopPropagation()
55+
e.preventDefault()
5556
}}
5657
onReset={onCancel}
5758
className={classNames(styles.multiFieldForm, styles.linkDialogEditForm)}

src/plugins/toolbar/primitives/DialogButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ const DialogForm: React.FC<{
147147

148148
const onSubmitEH = (e: React.FormEvent) => {
149149
e.preventDefault()
150-
e.nativeEvent.stopImmediatePropagation()
150+
e.stopPropagation()
151151
onSubmitCallback((inputProps as { value: string }).value)
152152
}
153153

0 commit comments

Comments
 (0)