diff --git a/.changeset/empty-pillows-exercise.md b/.changeset/empty-pillows-exercise.md new file mode 100644 index 0000000000..23cf04afd4 --- /dev/null +++ b/.changeset/empty-pillows-exercise.md @@ -0,0 +1,5 @@ +--- +'slate-react': patch +--- + +Ignore selectionchange events originating from input and textarea elements (addresses Chrome bug https://issues.chromium.org/issues/389368412) diff --git a/packages/slate-react/src/components/editable.tsx b/packages/slate-react/src/components/editable.tsx index 24a426a6a7..1503b7e403 100644 --- a/packages/slate-react/src/components/editable.tsx +++ b/packages/slate-react/src/components/editable.tsx @@ -856,15 +856,25 @@ export const Editable = forwardRef( useIsomorphicLayoutEffect(() => { const window = ReactEditor.getWindow(editor) + // COMPAT: In Chrome, `selectionchange` events can fire when and + //