@sproutsocial/seeds-react-menu 1.5.1 → 1.5.2
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/.turbo/turbo-build.log +8 -8
- package/CHANGELOG.md +8 -0
- package/dist/esm/index.js +6 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/NestedMenu/NestedMenu.tsx +8 -5
package/dist/index.js
CHANGED
|
@@ -4349,7 +4349,7 @@ var NestedMenu = ({
|
|
|
4349
4349
|
const [activeMenuContext, setActiveMenuContext] = (0, import_react32.useState)(defaultMenuContext);
|
|
4350
4350
|
const [currentMenuId, setCurrentMenuId] = (0, import_react32.useState)(initialMenuId);
|
|
4351
4351
|
const [isAdding, setIsAdding] = (0, import_react32.useState)(false);
|
|
4352
|
-
const
|
|
4352
|
+
const popoutUpdateRef = (0, import_react32.useRef)();
|
|
4353
4353
|
const setSelectedMenuId = (id) => {
|
|
4354
4354
|
setIsAdding(true);
|
|
4355
4355
|
setSelectedMenuPath((currentPath) => [...currentPath, id]);
|
|
@@ -4358,7 +4358,6 @@ var NestedMenu = ({
|
|
|
4358
4358
|
if (selectedMenuPath.length > 0) {
|
|
4359
4359
|
const newMenuId = selectedMenuPath[selectedMenuPath.length - 1];
|
|
4360
4360
|
setCurrentMenuId(newMenuId);
|
|
4361
|
-
popoutUpdateRef?.();
|
|
4362
4361
|
}
|
|
4363
4362
|
}, [selectedMenuPath.join("-")]);
|
|
4364
4363
|
const resetSelectedMenuPath = () => {
|
|
@@ -4480,6 +4479,9 @@ var NestedMenu = ({
|
|
|
4480
4479
|
),
|
|
4481
4480
|
...restMenuProps
|
|
4482
4481
|
};
|
|
4482
|
+
(0, import_react32.useEffect)(() => {
|
|
4483
|
+
popoutUpdateRef.current?.();
|
|
4484
|
+
}, [nestedMenuProps.children]);
|
|
4483
4485
|
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
4484
4486
|
NestedMenuProvider,
|
|
4485
4487
|
{
|
|
@@ -4513,7 +4515,7 @@ var NestedMenu = ({
|
|
|
4513
4515
|
menuToggleElement,
|
|
4514
4516
|
width: width2,
|
|
4515
4517
|
scheduleUpdateRef: (callback) => {
|
|
4516
|
-
|
|
4518
|
+
popoutUpdateRef.current = callback;
|
|
4517
4519
|
externalPopoutUpdateRef?.(callback);
|
|
4518
4520
|
},
|
|
4519
4521
|
...restPopoutProps
|