diff --git a/.changeset/old-cougars-destroy.md b/.changeset/old-cougars-destroy.md new file mode 100644 index 0000000000..f3bd134e6c --- /dev/null +++ b/.changeset/old-cougars-destroy.md @@ -0,0 +1,5 @@ +--- +'@udecode/plate-ui-toolbar': patch +--- + +Fix mark toolbar button not applying mark properly diff --git a/packages/ui/toolbar/src/MarkToolbarButton/MarkToolbarButton.tsx b/packages/ui/toolbar/src/MarkToolbarButton/MarkToolbarButton.tsx index 04aef439d8..f545d8a535 100644 --- a/packages/ui/toolbar/src/MarkToolbarButton/MarkToolbarButton.tsx +++ b/packages/ui/toolbar/src/MarkToolbarButton/MarkToolbarButton.tsx @@ -29,9 +29,7 @@ export const MarkToolbarButton = ({ e.stopPropagation(); toggleMark(editor, { key: type!, clear }); - setTimeout(() => { - focusEditor(editor, editor.selection ?? editor.prevSelection!); - }, 0); + focusEditor(editor); }} {...props} />