mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-04-20 13:22:04 +02:00
Avoid rendering an empty placeholder by default (#1356)
This commit is contained in:
parent
f045b597ea
commit
f9f7d34304
@ -751,6 +751,7 @@ function AfterPlugin() {
|
||||
|
||||
function renderPlaceholder(props) {
|
||||
const { editor, node } = props
|
||||
if (!editor.props.placeholder) return
|
||||
if (editor.state.isComposing) return
|
||||
if (node.kind != 'block') return
|
||||
if (!Text.isTextList(node.nodes)) return
|
||||
|
@ -17,7 +17,6 @@ export const value = (
|
||||
export const output = `
|
||||
<div data-slate-editor="true" contenteditable="true" role="textbox">
|
||||
<div style="position:relative">
|
||||
<span contenteditable="false" style="pointer-events:none;display:inline-block;width:0;max-width:100%;white-space:nowrap;opacity:0.333"></span>
|
||||
<span>
|
||||
<span>
|
||||
<span data-slate-empty-block="true">\n</span>
|
||||
|
@ -15,7 +15,6 @@ export const value = (
|
||||
export const output = `
|
||||
<div data-slate-editor="true" contenteditable="true" role="textbox">
|
||||
<div style="position:relative">
|
||||
<span contenteditable="false" style="pointer-events:none;display:inline-block;width:0;max-width:100%;white-space:nowrap;opacity:0.333"></span>
|
||||
<span>
|
||||
<span>
|
||||
<span data-slate-empty-block="true">\n</span>
|
||||
|
Loading…
x
Reference in New Issue
Block a user