mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-12 10:14:02 +02:00
Ensure the min-height for placeholders is set on the correct editor (#5148)
* Ensure the min-height for placeholders is set on the correct editor * Add changeset * Run prettier on changeset Co-authored-by: Dylan Schiemann <dylan@dojotoolkit.org>
This commit is contained in:
@@ -7,6 +7,7 @@ import {
|
||||
} from '../utils/weak-maps'
|
||||
import { RenderLeafProps, RenderPlaceholderProps } from './editable'
|
||||
import { useSlateStatic } from '../hooks/use-slate-static'
|
||||
import { ReactEditor } from '..'
|
||||
|
||||
/**
|
||||
* Individual leaves in a text node with unique formatting.
|
||||
@@ -34,9 +35,7 @@ const Leaf = (props: {
|
||||
|
||||
useEffect(() => {
|
||||
const placeholderEl = placeholderRef?.current
|
||||
const editorEl = document.querySelector<HTMLDivElement>(
|
||||
'[data-slate-editor="true"]'
|
||||
)
|
||||
const editorEl = ReactEditor.toDOMNode(editor, editor)
|
||||
|
||||
if (!placeholderEl || !editorEl) {
|
||||
return
|
||||
|
Reference in New Issue
Block a user