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

Commit 3474257

Browse files
allowing submenu to appear
1 parent 2c16b02 commit 3474257

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/components/DataManager/Toolbar/ActionsButton.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ export const ActionsButton = injector(observer(({ store, size, hasSelected, ...r
7373
const onClick = useCallback((e) => {
7474
e.preventDefault();
7575
e.stopPropagation();
76+
if (action.disabled) return;
7677
action?.callback ? action?.callback(store.currentView?.selected?.snapshot, action) : invokeAction(action, isDeleteAction);
7778
parentRef?.current?.close?.();
7879
}, [store.currentView?.selected]);
@@ -94,7 +95,7 @@ export const ActionsButton = injector(observer(({ store, size, hasSelected, ...r
9495
>
9596
<Elem name='titleContainer' {...(action.disabled ? { title: action.disabledReason } : {})}>
9697
<Elem name='title'>{action.title}</Elem>
97-
{(hasChildren && !action.disabled) ? <Elem name='icon' tag={FaChevronRight} /> : null}
98+
{(hasChildren) ? <Elem name='icon' tag={FaChevronRight} /> : null}
9899
</Elem>
99100
</Block>
100101
);
@@ -105,7 +106,7 @@ export const ActionsButton = injector(observer(({ store, size, hasSelected, ...r
105106
align="top-right-outside"
106107
toggle={false}
107108
ref={submenuRef}
108-
content={<Block name='actionButton-submenu' tag="ul" mod={{ newUI: isNewUI }}>{(!action.disabled) && action.children.map(ActionButton, parentRef)}</Block>}
109+
content={<Block name='actionButton-submenu' tag="ul" mod={{ newUI: isNewUI }}>{action.children.map(ActionButton, parentRef)}</Block>}
109110
>
110111
{titleContainer}
111112
</Dropdown.Trigger>

0 commit comments

Comments
 (0)