mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-23 23:42:56 +02:00
* Revert #5542 Revert due to issues introduced. * Add changeset
This commit is contained in:
5
.changeset/pink-lemons-guess.md
Normal file
5
.changeset/pink-lemons-guess.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'slate-react': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Revert #5542
|
@@ -4,7 +4,6 @@ import throttle from 'lodash/throttle'
|
|||||||
import React, {
|
import React, {
|
||||||
useCallback,
|
useCallback,
|
||||||
useEffect,
|
useEffect,
|
||||||
useLayoutEffect,
|
|
||||||
useMemo,
|
useMemo,
|
||||||
useReducer,
|
useReducer,
|
||||||
useRef,
|
useRef,
|
||||||
@@ -177,21 +176,6 @@ export const Editable = (props: EditableProps) => {
|
|||||||
[]
|
[]
|
||||||
)
|
)
|
||||||
|
|
||||||
useLayoutEffect(() => {
|
|
||||||
return () => {
|
|
||||||
if (state == null) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
// Avoid leaking DOM nodes when this component is unmounted.
|
|
||||||
if (state.latestElement != null) {
|
|
||||||
state.latestElement.remove()
|
|
||||||
}
|
|
||||||
if (state.latestElement != null) {
|
|
||||||
state.latestElement = null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, [])
|
|
||||||
|
|
||||||
// The autoFocus TextareaHTMLAttribute doesn't do anything on a div, so it
|
// The autoFocus TextareaHTMLAttribute doesn't do anything on a div, so it
|
||||||
// needs to be manually focused.
|
// needs to be manually focused.
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
Reference in New Issue
Block a user