mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-23 15:32:59 +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:
committed by
Ian Storm Taylor
parent
ae4758e1b7
commit
7f91d0b557
@@ -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>
|
||||
|
@@ -36,7 +36,7 @@ export const output = `
|
||||
<span data-slate-zero-width="z">​</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>
|
||||
|
Reference in New Issue
Block a user