diff --git a/wax-prosemirror-components/src/components/tables/CreateTable.js b/wax-prosemirror-components/src/components/tables/CreateTable.js index d60a4e00f88ffae3a0dbd79b75de761c3d1f10bd..00951d71502abc7c014f04d419c893e388468c5e 100644 --- a/wax-prosemirror-components/src/components/tables/CreateTable.js +++ b/wax-prosemirror-components/src/components/tables/CreateTable.js @@ -20,7 +20,7 @@ const ButtonStyled = styled.button` `; const InsertTableToolContainer = styled.div` - top: 50px; + top: 53px; position: absolute; height: auto; width: 167px; @@ -37,22 +37,17 @@ const CreateTable = ({ view = {}, item }) => { } const { state, dispatch } = view; - const [isTableToolDisplayed, setTableToolDisplay] = useState(false); - const showHideTable = () => { - setTableToolDisplay(!isTableToolDisplayed); - }; - const CreateButton = ( <ButtonStyled type="button" - isActive={item.active && item.active(view.state)} + isActive={isTableToolDisplayed} title={item.title} disabled={item.enable && !item.enable(view.state)} onMouseDown={e => { e.preventDefault(); - showHideTable(); + setTableToolDisplay(!isTableToolDisplayed); }} select={item.select && item.select(view.state, activeViewId)} >