Skip to content

Commit

Permalink
fix: flush onDOMSelectionChange on onDOMBeforeInput (#4809)
Browse files Browse the repository at this point in the history
  • Loading branch information
BitPhinix committed Jan 27, 2022
1 parent 2a18e75 commit e998752
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/wise-kings-serve.md
@@ -0,0 +1,5 @@
---
'slate-react': patch
---

Flush onDOMSelectionChange on onDOMBeforeInput
1 change: 1 addition & 0 deletions packages/slate-react/src/components/editable.tsx
Expand Up @@ -330,6 +330,7 @@ export const Editable = (props: EditableProps) => {
// triggering a `beforeinput` expecting the change to be applied to the immediately before
// set selection.
scheduleOnDOMSelectionChange.flush()
onDOMSelectionChange.flush()

const { selection } = editor
const { inputType: type } = event
Expand Down

0 comments on commit e998752

Please sign in to comment.