@tarviks/lexical-rich-editor 1.3.9 → 1.3.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -5184,6 +5184,18 @@ function TableActionMenuPlugin({ disabled = false }) {
5184
5184
  })
5185
5185
  );
5186
5186
  }, [editor, updateFromSelection]);
5187
+ React9.useEffect(() => {
5188
+ const root = editor.getRootElement();
5189
+ const reposition = () => updateFromSelection();
5190
+ window.addEventListener("resize", reposition);
5191
+ window.addEventListener("scroll", reposition, true);
5192
+ root?.addEventListener("scroll", reposition, { passive: true });
5193
+ return () => {
5194
+ window.removeEventListener("resize", reposition);
5195
+ window.removeEventListener("scroll", reposition, true);
5196
+ root?.removeEventListener("scroll", reposition);
5197
+ };
5198
+ }, [editor, updateFromSelection]);
5187
5199
  React9.useEffect(() => {
5188
5200
  return editor.registerCommand(
5189
5201
  KEY_DOWN_COMMAND,