1
0
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:
Blake Embrey 2017-10-31 08:32:36 -07:00 committed by Ian Storm Taylor
parent f045b597ea
commit f9f7d34304
3 changed files with 1 additions and 2 deletions

View File

@ -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

View File

@ -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>

View File

@ -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>