@lemonadejs/modal 5.2.1 → 5.3.0

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.
Files changed (2) hide show
  1. package/dist/index.js +13 -7
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -784,8 +784,10 @@ if (!lemonade && typeof (require) === 'function') {
784
784
  }
785
785
 
786
786
  // Auto adjust
787
- adjustHorizontal(self);
788
- adjustVertical(self);
787
+ queueMicrotask(() => {
788
+ adjustHorizontal(self);
789
+ adjustVertical(self);
790
+ });
789
791
  } else {
790
792
  // Hide backdrop
791
793
  if (backdrop) {
@@ -799,11 +801,15 @@ if (!lemonade && typeof (require) === 'function') {
799
801
  self.el.style[property] = '';
800
802
  }
801
803
 
802
- if (property === 'top') {
803
- adjustVertical(self);
804
- }
805
- if (property === 'left') {
806
- adjustHorizontal(self);
804
+ if (self.closed === false) {
805
+ queueMicrotask(() => {
806
+ if (property === 'top') {
807
+ adjustVertical(self);
808
+ }
809
+ if (property === 'left') {
810
+ adjustHorizontal(self);
811
+ }
812
+ });
807
813
  }
808
814
  } else if (property === 'position') {
809
815
  if (self.position) {
package/package.json CHANGED
@@ -13,9 +13,9 @@
13
13
  "modal js"
14
14
  ],
15
15
  "dependencies": {
16
- "lemonadejs": "^5.2.0"
16
+ "lemonadejs": "^5.3.1"
17
17
  },
18
18
  "main": "dist/index.js",
19
19
  "types": "dist/index.d.ts",
20
- "version": "5.2.1"
20
+ "version": "5.3.0"
21
21
  }