@carbon/react 1.85.0 → 1.85.1
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.
|
@@ -58,14 +58,12 @@ const HeaderPanel = /*#__PURE__*/React.forwardRef(function HeaderPanel({
|
|
|
58
58
|
}
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
|
-
useWindowEvent('click',
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
if (!(activeElement instanceof HTMLElement)) return;
|
|
66
|
-
setLastClickedElement(activeElement);
|
|
61
|
+
useWindowEvent('click', event => {
|
|
62
|
+
const target = event.target;
|
|
63
|
+
if (!(target instanceof HTMLElement)) return;
|
|
64
|
+
setLastClickedElement(target);
|
|
67
65
|
const isChildASwitcher = /*#__PURE__*/isValidElement(children) && typeof children.type !== 'string' && children.type === Switcher;
|
|
68
|
-
if (isChildASwitcher && !
|
|
66
|
+
if (isChildASwitcher && !target.closest(`.${prefix}--header-panel--expanded`) && !target.closest(`.${prefix}--header__action`) && !headerPanelReference?.current?.classList.contains(`${prefix}--switcher`) && expanded) {
|
|
69
67
|
setExpandedState(false);
|
|
70
68
|
onHeaderPanelFocus();
|
|
71
69
|
}
|
|
@@ -68,14 +68,12 @@ const HeaderPanel = /*#__PURE__*/React__default["default"].forwardRef(function H
|
|
|
68
68
|
}
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
|
-
useEvent.useWindowEvent('click',
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
if (!(activeElement instanceof HTMLElement)) return;
|
|
76
|
-
setLastClickedElement(activeElement);
|
|
71
|
+
useEvent.useWindowEvent('click', event => {
|
|
72
|
+
const target = event.target;
|
|
73
|
+
if (!(target instanceof HTMLElement)) return;
|
|
74
|
+
setLastClickedElement(target);
|
|
77
75
|
const isChildASwitcher = /*#__PURE__*/React.isValidElement(children) && typeof children.type !== 'string' && children.type === Switcher["default"];
|
|
78
|
-
if (isChildASwitcher && !
|
|
76
|
+
if (isChildASwitcher && !target.closest(`.${prefix}--header-panel--expanded`) && !target.closest(`.${prefix}--header__action`) && !headerPanelReference?.current?.classList.contains(`${prefix}--switcher`) && expanded) {
|
|
79
77
|
setExpandedState(false);
|
|
80
78
|
onHeaderPanelFocus();
|
|
81
79
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carbon/react",
|
|
3
3
|
"description": "React components for the Carbon Design System",
|
|
4
|
-
"version": "1.85.
|
|
4
|
+
"version": "1.85.1",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"types": "lib/index.d.ts",
|
|
@@ -139,5 +139,5 @@
|
|
|
139
139
|
"**/*.scss",
|
|
140
140
|
"**/*.css"
|
|
141
141
|
],
|
|
142
|
-
"gitHead": "
|
|
142
|
+
"gitHead": "467c96c1d82d6b1261cf8f17ee1c8b27d0bc572f"
|
|
143
143
|
}
|