diff --git a/packages/editor/src/toolbar/components/more-tools.tsx b/packages/editor/src/toolbar/components/more-tools.tsx index 8b3693fb2..5b34f84d9 100644 --- a/packages/editor/src/toolbar/components/more-tools.tsx +++ b/packages/editor/src/toolbar/components/more-tools.tsx @@ -32,9 +32,10 @@ type MoreToolsProps = ToolProps & { tools: ToolId[]; autoCloseOnUnmount?: boolean; autoOpen?: boolean; + group?: string; }; export function MoreTools(props: MoreToolsProps) { - const { popupId, editor, tools, autoCloseOnUnmount, autoOpen } = props; + const { popupId, editor, tools, autoCloseOnUnmount, autoOpen, group } = props; const toolbarLocation = useToolbarLocation(); const isBottom = toolbarLocation === "bottom"; const buttonRef = useRef(null); @@ -51,7 +52,7 @@ export function MoreTools(props: MoreToolsProps) { /> { - return Math.max(1, borderWidth - 1); - }, [borderWidth]); + return Math.max(1, borderWidthAsNumber.current - 1); + }, [borderWidthAsNumber]); const increaseBorderWidth = useCallback(() => { - return Math.min(10, borderWidth + 1); - }, [borderWidth]); + return Math.min(10, borderWidthAsNumber.current + 1); + }, [borderWidthAsNumber]); return ( - - - Border width: - - - editor.current?.commands.setCellAttribute( - "borderWidth", - decreaseBorderWidth() - ) - } - onIncrease={() => - editor.current?.commands.setCellAttribute( - "borderWidth", - increaseBorderWidth() - ) - } - onReset={() => - editor.current?.commands.setCellAttribute("borderWidth", 1) - } - value={borderWidth + "px"} - /> - + + editor.current?.commands.setCellAttribute( + "borderWidth", + decreaseBorderWidth() + ) + } + onIncrease={() => + editor.current?.commands.setCellAttribute( + "borderWidth", + increaseBorderWidth() + ) + } + onReset={() => + editor.current?.commands.setCellAttribute("borderWidth", 1) + } + value={borderWidth + "px"} + /> ); }