@innovastudio/contentbox 1.6.182 → 1.6.183

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@innovastudio/contentbox",
3
3
  "type": "module",
4
- "version": "1.6.182",
4
+ "version": "1.6.183",
5
5
  "description": "",
6
6
  "main": "public/contentbox/contentbox.esm.js",
7
7
  "types": "index.d.ts",
@@ -148985,14 +148985,20 @@ ${this.builder.html()}
148985
148985
  this.streamController.abort();
148986
148986
  }
148987
148987
 
148988
- this.modal.classList.add('hidden');
148989
- this.modal.setAttribute('aria-hidden', 'true');
148990
- this.modal.setAttribute('inert', '');
148991
-
148992
148988
  if (this.lastFocusedElement && this.lastFocusedElement !== document.body) {
148993
148989
  this.lastFocusedElement.focus();
148990
+ } else {
148991
+ // Move focus out BEFORE hiding
148992
+ const activeEl = document.activeElement;
148993
+
148994
+ if (activeEl && this.modal.contains(activeEl)) {
148995
+ activeEl.blur();
148996
+ }
148994
148997
  }
148995
148998
 
148999
+ this.modal.classList.add('hidden');
149000
+ this.modal.setAttribute('aria-hidden', 'true');
149001
+ this.modal.setAttribute('inert', '');
148996
149002
  localStorage.setItem('chatPanelVisible', 'false');
148997
149003
  this.announceToScreenReader(out('Chat panel closed'));
148998
149004
  }