@carbon-labs/react-ui-shell 0.61.0 → 0.63.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.
@@ -341,6 +341,14 @@ function SideNavRenderFunction({
341
341
  handleToggle(true, true);
342
342
  };
343
343
  }
344
+ useWindowEvent('click', event => {
345
+ const target = event.target;
346
+ const isNavItemClick = target.closest(`.${prefix}--side-nav a, .${prefix}--side-nav button`);
347
+ const isInRail = isNavItemClick?.closest(`.${prefix}--side-nav--rail`);
348
+ if (isNavItemClick && !isNavItemClick.classList.contains(`${prefix}--side-nav__submenu`)) {
349
+ isInRail ? handleToggle(false, false) : onSideNavBlur?.();
350
+ }
351
+ });
344
352
  useWindowEvent('keydown', event => {
345
353
  const focusedElement = document.activeElement;
346
354
 
@@ -343,6 +343,14 @@ function SideNavRenderFunction({
343
343
  handleToggle(true, true);
344
344
  };
345
345
  }
346
+ useEvent.useWindowEvent('click', event => {
347
+ const target = event.target;
348
+ const isNavItemClick = target.closest(`.${prefix}--side-nav a, .${prefix}--side-nav button`);
349
+ const isInRail = isNavItemClick?.closest(`.${prefix}--side-nav--rail`);
350
+ if (isNavItemClick && !isNavItemClick.classList.contains(`${prefix}--side-nav__submenu`)) {
351
+ isInRail ? handleToggle(false, false) : onSideNavBlur?.();
352
+ }
353
+ });
346
354
  useEvent.useWindowEvent('keydown', event => {
347
355
  const focusedElement = document.activeElement;
348
356
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carbon-labs/react-ui-shell",
3
- "version": "0.61.0",
3
+ "version": "0.63.0",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": true
@@ -42,5 +42,5 @@
42
42
  "dependencies": {
43
43
  "@ibm/telemetry-js": "^1.9.1"
44
44
  },
45
- "gitHead": "9a7e0911865b850569e3832039d1860ffebd2533"
45
+ "gitHead": "7a88a54b5d9e12176f9b9d354c7dfb78c16c1d2f"
46
46
  }