Skip to content

Commit 2e224a5

Browse files
authored
Fix submit of bookmark editor (#728)
1 parent 93ff799 commit 2e224a5

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

src/BookmarkEditor/component.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
dialog.BookmarkEditor {
88
width: auto;
99
max-width: 800px;
10-
padding: var(--size-wide-gap);
10+
padding: inherit;
1111
color: inherit;
1212
background-color: var(--palette-3);
1313
border-style: none;
@@ -22,6 +22,7 @@ dialog.BookmarkEditor::backdrop {
2222
.BookmarkEditor__Form {
2323
display: grid;
2424
gap: var(--size-gap);
25+
padding: var(--size-wide-gap);
2526
}
2627

2728
.BookmarkEditor__Group {

src/Dialog/component.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,8 @@ const DialogComponent: FC<DialogComponentProps> = ({ children, open, onRequestCl
2929
className={className}
3030
onCancel={onRequestClose}
3131
onClick={(e) => {
32-
if (dialogRef.current === null) {
33-
return
34-
}
35-
if (!isClickedInRect(e, dialogRef.current.getBoundingClientRect())) {
32+
// Close the dialog when the backdrop is clicked
33+
if (e.target === dialogRef.current) {
3634
onRequestClose()
3735
}
3836
}}
@@ -46,6 +44,3 @@ const DialogComponent: FC<DialogComponentProps> = ({ children, open, onRequestCl
4644
}
4745

4846
export default DialogComponent
49-
50-
const isClickedInRect = (e: React.MouseEvent, r: DOMRect): boolean =>
51-
e.clientX > r.left && e.clientX < r.right && e.clientY > r.top && e.clientY < r.bottom

src/Preferences/component.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
}
66

77
dialog.Preferences {
8-
padding: var(--size-wide-gap);
8+
padding: inherit;
99
color: inherit;
1010
background-color: var(--palette-3);
1111
border-style: none;
@@ -20,6 +20,7 @@ dialog.Preferences::backdrop {
2020
.Preferences__Form {
2121
display: grid;
2222
gap: var(--size-gap);
23+
padding: var(--size-wide-gap);
2324
}
2425

2526
.Preferences h2 {

0 commit comments

Comments
 (0)