1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-23 07:22:55 +02:00

Inline Void block cursor (#1886)

* add contentEditable=false to void block wrapper

* put contentEditable fals on inline void

fix from https://github.com/ianstormtaylor/slate/pull/1734 works for block but inline void have a cursor which shouldn’t be there as typing inside inline void won’t work. so only removing contentEditable on blocks but not inline

* update test
This commit is contained in:
Irwan Fario Subastian
2018-06-11 09:59:16 +10:00
committed by Ian Storm Taylor
parent ae4758e1b7
commit 7f91d0b557
2 changed files with 6 additions and 2 deletions

View File

@@ -79,7 +79,11 @@ class Void extends React.Component {
this.debug('render', { props })
return (
<Tag data-slate-void data-key={node.key}>
<Tag
data-slate-void
data-key={node.key}
contentEditable={readOnly || node.object == 'block' ? null : false}
>
{readOnly ? null : spacer}
{content}
</Tag>

View File

@@ -36,7 +36,7 @@ export const output = `
<span data-slate-zero-width="z">&#x200B;</span>
</span>
</span>
<span data-slate-void="true">
<span data-slate-void="true" contenteditable="false">
<span data-slate-spacer="true" style="height:0;color:transparent;outline:none;position:absolute">
<span>
<span>