@primer/view-components 0.18.1-rc.e20b9eff → 0.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18,7 +18,6 @@ function dialogInvokerButtonHandler(event) {
|
|
18
18
|
// If the user is clicking a valid dialog trigger
|
19
19
|
let dialogId = button === null || button === void 0 ? void 0 : button.getAttribute('data-show-dialog-id');
|
20
20
|
if (dialogId) {
|
21
|
-
event.stopPropagation();
|
22
21
|
const dialog = document.getElementById(dialogId);
|
23
22
|
if (dialog instanceof HTMLDialogElement) {
|
24
23
|
dialog.showModal();
|
@@ -26,7 +25,6 @@ function dialogInvokerButtonHandler(event) {
|
|
26
25
|
// If the behaviour is allowed through the dialog will be shown but then
|
27
26
|
// quickly hidden- as if it were never shown. This prevents that.
|
28
27
|
event.preventDefault();
|
29
|
-
event.stopPropagation();
|
30
28
|
}
|
31
29
|
}
|
32
30
|
dialogId = button.getAttribute('data-close-dialog-id') || button.getAttribute('data-submit-dialog-id');
|
@@ -80,11 +78,8 @@ export class DialogHelperElement extends HTMLElement {
|
|
80
78
|
handleEvent(event) {
|
81
79
|
const target = event.target;
|
82
80
|
const dialog = this.dialog;
|
83
|
-
|
84
|
-
|
85
|
-
// if the target is inside the dialog, but is not the dialog itself, leave
|
86
|
-
// the dialog open
|
87
|
-
if ((target === null || target === void 0 ? void 0 : target.closest('dialog')) === dialog && target !== dialog)
|
81
|
+
// The click target _must_ be the dialog element itself, and not elements underneath or inside.
|
82
|
+
if (target !== dialog || !(dialog === null || dialog === void 0 ? void 0 : dialog.open))
|
88
83
|
return;
|
89
84
|
const rect = dialog.getBoundingClientRect();
|
90
85
|
const clickWasInsideDialog = rect.top <= event.clientY &&
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@primer/view-components",
|
3
|
-
"version": "0.18.1
|
3
|
+
"version": "0.18.1",
|
4
4
|
"description": "ViewComponents for the Primer Design System",
|
5
5
|
"main": "app/assets/javascripts/primer_view_components.js",
|
6
6
|
"module": "app/components/primer/primer.js",
|
package/static/info_arch.json
CHANGED
@@ -3375,6 +3375,19 @@
|
|
3375
3375
|
"color-contrast"
|
3376
3376
|
]
|
3377
3377
|
}
|
3378
|
+
},
|
3379
|
+
{
|
3380
|
+
"preview_path": "primer/alpha/dialog/dialog_inside_overlay",
|
3381
|
+
"name": "dialog_inside_overlay",
|
3382
|
+
"snapshot": "false",
|
3383
|
+
"skip_rules": {
|
3384
|
+
"wont_fix": [
|
3385
|
+
"region"
|
3386
|
+
],
|
3387
|
+
"will_fix": [
|
3388
|
+
"color-contrast"
|
3389
|
+
]
|
3390
|
+
}
|
3378
3391
|
}
|
3379
3392
|
],
|
3380
3393
|
"subcomponents": [
|
package/static/previews.json
CHANGED
@@ -3139,6 +3139,19 @@
|
|
3139
3139
|
"color-contrast"
|
3140
3140
|
]
|
3141
3141
|
}
|
3142
|
+
},
|
3143
|
+
{
|
3144
|
+
"preview_path": "primer/alpha/dialog/dialog_inside_overlay",
|
3145
|
+
"name": "dialog_inside_overlay",
|
3146
|
+
"snapshot": "false",
|
3147
|
+
"skip_rules": {
|
3148
|
+
"wont_fix": [
|
3149
|
+
"region"
|
3150
|
+
],
|
3151
|
+
"will_fix": [
|
3152
|
+
"color-contrast"
|
3153
|
+
]
|
3154
|
+
}
|
3142
3155
|
}
|
3143
3156
|
]
|
3144
3157
|
},
|