Skip to content

Commit

Permalink
Add event listener for the editor transaction to set the selected for…
Browse files Browse the repository at this point in the history
…matting highlighted in the menu bar. (#1244)
  • Loading branch information
deepakjosp authored Oct 22, 2024
1 parent d06b861 commit 1ec4fb8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/Editor/Menu/Fixed/hooks/useEditorState.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,12 @@ const useEditorState = ({ editor }) => {

editor.on("selectionUpdate", handleSelectionUpdate);
editor.on("update", handleSelectionUpdate);
editor.on("transaction", handleSelectionUpdate);

return () => {
editor.off("selectionUpdate", handleSelectionUpdate);
editor.off("update", handleSelectionUpdate);
editor.off("transaction", handleSelectionUpdate);
};
}, [editor, handleSelectionUpdate]);
};
Expand Down

0 comments on commit 1ec4fb8

Please sign in to comment.