@nys-cui/cui-formpill 0.2.4 → 0.2.6

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
@@ -6,7 +6,7 @@
6
6
  },
7
7
  "main": "./dist/js/cui-formpill.js",
8
8
  "type": "module",
9
- "version": "0.2.4",
9
+ "version": "0.2.6",
10
10
  "scripts": {
11
11
  "clean": "rm -rf ./dist",
12
12
  "build": "npm run clean && cui --dep",
@@ -147,6 +147,15 @@ class CUI_FORMPILL_PILL extends HTMLElement {
147
147
 
148
148
  }
149
149
 
150
+ disconnectedCallback() {
151
+
152
+ for (let dPopover of document.body.querySelectorAll('cui-formpill-popover')) {
153
+ if (dPopover.state.dFor === this) {
154
+ document.body.removeChild(dPopover);
155
+ }
156
+ }
157
+ }
158
+
150
159
 
151
160
  }
152
161
 
@@ -296,6 +305,15 @@ class CUI_FORMPILL extends HTMLElement {
296
305
 
297
306
  }
298
307
 
308
+ if (this._state.dMenuPopover) {
309
+ this._state.dMenuPopover.state.bOpen = false;
310
+ document.body.removeChild(this._state.dMenuPopover)
311
+ this._state.dMenuPopover = null;
312
+ document.body.removeEventListener('click', this.fGlobalBodyClick);
313
+ this._state.bMenuDisplayed = false;
314
+ }
315
+
316
+
299
317
  this.render(true);
300
318
  }
301
319
  get label() {
@@ -830,7 +848,7 @@ class CUI_FORMPILL extends HTMLElement {
830
848
  if (controls.value.search) {
831
849
  this.dValueField.setAttribute('search', true)
832
850
  }
833
-
851
+
834
852
  if (pill._state.sValue2.indexOf(',') == -1) {
835
853
  this.dValueField.setAttribute('value', pill._state.sValue2)
836
854
  }
@@ -1280,7 +1298,9 @@ class CUI_FORMPILL extends HTMLElement {
1280
1298
 
1281
1299
  if (this._state.dMenuPopover) {
1282
1300
  this._state.dMenuPopover.state.bOpen = false;
1283
- this._state.dMenuPopover.parentNode.removeChild(this._state.dMenuPopover)
1301
+ if(this._state.dMenuPopover.isConnected) {
1302
+ document.body.removeChild(this._state.dMenuPopover);
1303
+ }
1284
1304
  this._state.dMenuPopover = null;
1285
1305
  }
1286
1306