From 21347b9a33387b6a2d6ce24d5b93c33af8415c5b Mon Sep 17 00:00:00 2001 From: Yannis Barlas <yannisbarlas@gmail.com> Date: Mon, 28 Sep 2020 23:33:20 +0300 Subject: [PATCH] fix select on button --- wax-prosemirror-components/src/components/Button.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/wax-prosemirror-components/src/components/Button.js b/wax-prosemirror-components/src/components/Button.js index e4d4f71c3..4f6fe323b 100644 --- a/wax-prosemirror-components/src/components/Button.js +++ b/wax-prosemirror-components/src/components/Button.js @@ -18,11 +18,11 @@ import MenuButton from '../ui/buttons/MenuButton'; // `; const Button = ({ view = {}, item }) => { - const { active, enable, icon, label, onlyOnMain, run, title } = item; + const { active, enable, icon, label, onlyOnMain, run, select, title } = item; const { view: { main }, - // activeViewId, + activeViewId, } = useContext(WaxContext); if (onlyOnMain) view = main; @@ -36,10 +36,8 @@ const Button = ({ view = {}, item }) => { const isActive = active && active(state); - const isDisabled = enable && !enable(state); - // && - // item.select && - // item.select(view.state, activeViewId); + const isDisabled = + enable && !enable(state) && select && select(view.state, activeViewId); return ( <MenuButton -- GitLab