@primer/view-components 0.18.1-rc.671a5d11 → 0.18.1-rc.e20b9eff

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,6 +18,7 @@ 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();
21
22
  const dialog = document.getElementById(dialogId);
22
23
  if (dialog instanceof HTMLDialogElement) {
23
24
  dialog.showModal();
@@ -25,6 +26,7 @@ function dialogInvokerButtonHandler(event) {
25
26
  // If the behaviour is allowed through the dialog will be shown but then
26
27
  // quickly hidden- as if it were never shown. This prevents that.
27
28
  event.preventDefault();
29
+ event.stopPropagation();
28
30
  }
29
31
  }
30
32
  dialogId = button.getAttribute('data-close-dialog-id') || button.getAttribute('data-submit-dialog-id');
@@ -78,8 +80,11 @@ export class DialogHelperElement extends HTMLElement {
78
80
  handleEvent(event) {
79
81
  const target = event.target;
80
82
  const dialog = this.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))
83
+ if (!(dialog === null || dialog === void 0 ? void 0 : dialog.open))
84
+ return;
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)
83
88
  return;
84
89
  const rect = dialog.getBoundingClientRect();
85
90
  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-rc.671a5d11",
3
+ "version": "0.18.1-rc.e20b9eff",
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",
@@ -3375,19 +3375,6 @@
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
- }
3391
3378
  }
3392
3379
  ],
3393
3380
  "subcomponents": [
@@ -3139,19 +3139,6 @@
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
- }
3155
3142
  }
3156
3143
  ]
3157
3144
  },