Skip to content

Commit

Permalink
Revert #5542 (#5556)
Browse files Browse the repository at this point in the history
* Revert #5542

Revert due to issues introduced.

* Add changeset
  • Loading branch information
dylans authored Nov 10, 2023
1 parent fc08181 commit 22495e1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
5 changes: 5 additions & 0 deletions .changeset/pink-lemons-guess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'slate-react': patch
---

Revert #5542
16 changes: 0 additions & 16 deletions packages/slate-react/src/components/editable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import throttle from 'lodash/throttle'
import React, {
useCallback,
useEffect,
useLayoutEffect,
useMemo,
useReducer,
useRef,
Expand Down Expand Up @@ -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
// needs to be manually focused.
useEffect(() => {
Expand Down

0 comments on commit 22495e1

Please sign in to comment.