Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Commit

Permalink
allowing submenu to appear
Browse files Browse the repository at this point in the history
  • Loading branch information
yyassi-heartex committed Nov 29, 2023
1 parent 2c16b02 commit 3474257
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/DataManager/Toolbar/ActionsButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export const ActionsButton = injector(observer(({ store, size, hasSelected, ...r
const onClick = useCallback((e) => {
e.preventDefault();
e.stopPropagation();
if (action.disabled) return;
action?.callback ? action?.callback(store.currentView?.selected?.snapshot, action) : invokeAction(action, isDeleteAction);
parentRef?.current?.close?.();
}, [store.currentView?.selected]);
Expand All @@ -94,7 +95,7 @@ export const ActionsButton = injector(observer(({ store, size, hasSelected, ...r
>
<Elem name='titleContainer' {...(action.disabled ? { title: action.disabledReason } : {})}>
<Elem name='title'>{action.title}</Elem>
{(hasChildren && !action.disabled) ? <Elem name='icon' tag={FaChevronRight} /> : null}
{(hasChildren) ? <Elem name='icon' tag={FaChevronRight} /> : null}
</Elem>
</Block>
);
Expand All @@ -105,7 +106,7 @@ export const ActionsButton = injector(observer(({ store, size, hasSelected, ...r
align="top-right-outside"
toggle={false}
ref={submenuRef}
content={<Block name='actionButton-submenu' tag="ul" mod={{ newUI: isNewUI }}>{(!action.disabled) && action.children.map(ActionButton, parentRef)}</Block>}
content={<Block name='actionButton-submenu' tag="ul" mod={{ newUI: isNewUI }}>{action.children.map(ActionButton, parentRef)}</Block>}
>
{titleContainer}
</Dropdown.Trigger>
Expand Down

0 comments on commit 3474257

Please sign in to comment.