mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-04 14:27:27 +02:00
Avoid rendering an empty placeholder by default (#1356)
This commit is contained in:
committed by
Ian Storm Taylor
parent
f045b597ea
commit
f9f7d34304
@@ -751,6 +751,7 @@ function AfterPlugin() {
|
|||||||
|
|
||||||
function renderPlaceholder(props) {
|
function renderPlaceholder(props) {
|
||||||
const { editor, node } = props
|
const { editor, node } = props
|
||||||
|
if (!editor.props.placeholder) return
|
||||||
if (editor.state.isComposing) return
|
if (editor.state.isComposing) return
|
||||||
if (node.kind != 'block') return
|
if (node.kind != 'block') return
|
||||||
if (!Text.isTextList(node.nodes)) return
|
if (!Text.isTextList(node.nodes)) return
|
||||||
|
@@ -17,7 +17,6 @@ export const value = (
|
|||||||
export const output = `
|
export const output = `
|
||||||
<div data-slate-editor="true" contenteditable="true" role="textbox">
|
<div data-slate-editor="true" contenteditable="true" role="textbox">
|
||||||
<div style="position:relative">
|
<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>
|
<span>
|
||||||
<span data-slate-empty-block="true">\n</span>
|
<span data-slate-empty-block="true">\n</span>
|
||||||
|
@@ -15,7 +15,6 @@ export const value = (
|
|||||||
export const output = `
|
export const output = `
|
||||||
<div data-slate-editor="true" contenteditable="true" role="textbox">
|
<div data-slate-editor="true" contenteditable="true" role="textbox">
|
||||||
<div style="position:relative">
|
<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>
|
<span>
|
||||||
<span data-slate-empty-block="true">\n</span>
|
<span data-slate-empty-block="true">\n</span>
|
||||||
|
Reference in New Issue
Block a user