@primer/view-components 0.18.1-rc.096ff957 → 0.18.1-rc.29c58b96

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.096ff957",
3
+ "version": "0.18.1-rc.29c58b96",
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",