@justeattakeaway/pie-modal 0.49.0 → 0.49.2

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.
package/dist/index.js CHANGED
@@ -96,7 +96,7 @@ const v = "pie-modal", C = class C extends I(F) {
96
96
  super(...arguments), this.headingLevel = r.headingLevel, this.hasBackButton = r.hasBackButton, this.hasStackedActions = r.hasStackedActions, this.isDismissible = r.isDismissible, this.isFooterPinned = r.isFooterPinned, this.isFullWidthBelowMid = r.isFullWidthBelowMid, this.isLoading = r.isLoading, this.isOpen = r.isOpen, this.position = r.position, this.size = r.size, this._backButtonClicked = !1, this._escKeyAbortController = null, this._preventModalKeyboardDismissal = (e) => {
97
97
  e.key === "Escape" && e.preventDefault();
98
98
  }, this._handleDialogLightDismiss = (e) => {
99
- if (!this.isDismissible)
99
+ if (!this.isDismissible || e.target !== e.currentTarget)
100
100
  return;
101
101
  const o = this._dialog.getBoundingClientRect(), {
102
102
  top: t = 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@justeattakeaway/pie-modal",
3
- "version": "0.49.0",
3
+ "version": "0.49.2",
4
4
  "description": "PIE design system modal built using web components",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -37,8 +37,10 @@
37
37
  "devDependencies": {
38
38
  "@custom-elements-manifest/analyzer": "0.9.0",
39
39
  "@justeat/pie-design-tokens": "6.5.0",
40
+ "@justeattakeaway/pie-button": "0.49.3",
40
41
  "@justeattakeaway/pie-components-config": "0.18.0",
41
42
  "@justeattakeaway/pie-css": "0.13.1",
43
+ "@justeattakeaway/pie-text-input": "0.24.3",
42
44
  "@justeattakeaway/pie-wrapper-react": "0.14.2",
43
45
  "@types/body-scroll-lock": "3.1.2",
44
46
  "cem-plugin-module-file-extensions": "0.0.5"
@@ -48,8 +50,8 @@
48
50
  },
49
51
  "dependencies": {
50
52
  "@justeattakeaway/pie-button": "0.49.3",
51
- "@justeattakeaway/pie-icon-button": "0.28.14",
52
- "@justeattakeaway/pie-icons-webc": "0.25.3",
53
+ "@justeattakeaway/pie-icon-button": "0.29.0",
54
+ "@justeattakeaway/pie-icons-webc": "1.0.0",
53
55
  "@justeattakeaway/pie-spinner": "0.7.2",
54
56
  "@justeattakeaway/pie-webc-core": "0.24.2",
55
57
  "body-scroll-lock": "3.1.5",
package/src/index.ts CHANGED
@@ -540,7 +540,8 @@ export class PieModal extends RtlMixin(LitElement) implements ModalProps {
540
540
  * @param {MouseEvent} event - the click event targetting the modal/backdrop
541
541
  */
542
542
  private _handleDialogLightDismiss = (event: MouseEvent): void => {
543
- if (!this.isDismissible) {
543
+ // Early return if the dialog isn't dismissible or the clicked element isn't the dialog itself
544
+ if (!this.isDismissible || event.target !== event.currentTarget) {
544
545
  return;
545
546
  }
546
547