mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-13 10:44:02 +02:00
fix: cancel debounced listeners in Editable (#5322)
* fix: cancel debounced listeners in Editable * fix: add change set
This commit is contained in:
@@ -701,6 +701,9 @@ export const Editable = (props: EditableProps) => {
|
||||
const callbackRef = useCallback(
|
||||
node => {
|
||||
if (node == null) {
|
||||
onDOMSelectionChange.cancel()
|
||||
scheduleOnDOMSelectionChange.cancel()
|
||||
|
||||
EDITOR_TO_ELEMENT.delete(editor)
|
||||
NODE_TO_ELEMENT.delete(editor)
|
||||
|
||||
@@ -721,7 +724,7 @@ export const Editable = (props: EditableProps) => {
|
||||
|
||||
ref.current = node
|
||||
},
|
||||
[ref, onDOMBeforeInput]
|
||||
[ref, onDOMBeforeInput, onDOMSelectionChange, scheduleOnDOMSelectionChange]
|
||||
)
|
||||
|
||||
// Attach a native DOM event handler for `selectionchange`, because React's
|
||||
|
Reference in New Issue
Block a user