diff --git a/wax-prosemirror-components/src/components/Button.js b/wax-prosemirror-components/src/components/Button.js index e4d4f71c342ffb8aeb3043d70019fb75bc86833c..4f6fe323be2b90a6d93bb58bf6f37bab9fe1b984 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