@webqit/webflo 0.20.57 → 0.20.58

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/package.json CHANGED
@@ -12,7 +12,7 @@
12
12
  "vanila-javascript"
13
13
  ],
14
14
  "homepage": "https://webqit.io/tooling/webflo",
15
- "version": "0.20.57",
15
+ "version": "0.20.58",
16
16
  "license": "MIT",
17
17
  "repository": {
18
18
  "type": "git",
@@ -406,7 +406,7 @@ export class ModalElement extends BaseElement {
406
406
  }
407
407
 
408
408
  static get observedAttributes() {
409
- return super.observedAttributes.concat(['class']);
409
+ return super.observedAttributes.concat(['class', 'open']);
410
410
  }
411
411
 
412
412
  get delegatesFocus() { return false; }
@@ -559,6 +559,13 @@ export class ModalElement extends BaseElement {
559
559
  super.attributeChangedCallback?.(name, old, _new);
560
560
 
561
561
  if (name === 'class' && old !== _new) this.#bindDimensionsWorker();
562
+ if (name === 'open' && this.isConnected) {
563
+ if (this.hasAttribute('open') && !this.matches(':popover-open')) {
564
+ this.showPopover();
565
+ } else if (!this.hasAttribute('open') && this.matches(':popover-open')) {
566
+ this.hidePopover();
567
+ }
568
+ }
562
569
  }
563
570
 
564
571
  connectedCallback() {
@@ -567,9 +574,6 @@ export class ModalElement extends BaseElement {
567
574
  if (!this.popover) {
568
575
  this.popover = 'manual';
569
576
  }
570
- if (this.hasAttribute('open')) {
571
- this.showPopover();
572
- }
573
577
  }
574
578
 
575
579
  disconnectedCallback() {
@@ -612,6 +616,8 @@ export class ModalElement extends BaseElement {
612
616
  this.#unbindDimensionsWorker = null;
613
617
  this.#unbindMinmaxWorker?.();
614
618
  this.#unbindMinmaxWorker = null;
619
+
620
+ this.removeAttribute('open');
615
621
  }
616
622
  });
617
623