native-document 1.0.216 → 1.0.217

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "native-document",
3
- "version": "1.0.216",
3
+ "version": "1.0.217",
4
4
  "description": "A reactive JavaScript framework that preserves native DOM simplicity without sacrificing modern features",
5
5
  "author": "AfroCodeur <https://github.com/afrocodeur>",
6
6
  "license": "MIT",
@@ -1,9 +1,10 @@
1
1
  import { $ } from '../../core/data/Observable';
2
2
  import {createPortal} from '../../core/elements/anchor/anchor';
3
3
  import Modal from './Modal';
4
+ import {once} from '../../core/utils/cache';
4
5
 
5
6
  export function createModal(builder) {
6
- return Cache.once(() => {
7
+ return once(() => {
7
8
 
8
9
  const $modalRef = $.ref();
9
10
  let currentOnSelect = null;
@@ -37,7 +38,9 @@ export function createModal(builder) {
37
38
  createPortal(
38
39
  modal
39
40
  .onClose(() => {
40
- finish(null);
41
+ if(currentOnSelect !== null) {
42
+ finish(null);
43
+ }
41
44
  events.onClose && events.onClose();
42
45
  })
43
46
  .ref($modalRef),