@carbon-labs/react-ui-shell 0.61.0 → 0.62.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.
package/es/components/SideNav.js
CHANGED
|
@@ -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) {
|
|
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) {
|
|
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.
|
|
3
|
+
"version": "0.62.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": "
|
|
45
|
+
"gitHead": "9656b7b03d0232cdda3cf200d972eaf727a35fbc"
|
|
46
46
|
}
|