mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-20 06:01:24 +02:00
tweak void styles, fix tests
This commit is contained in:
@@ -128,20 +128,13 @@ class Void extends React.Component {
|
|||||||
const Tag = node.kind == 'block' ? 'div' : 'span'
|
const Tag = node.kind == 'block' ? 'div' : 'span'
|
||||||
let style
|
let style
|
||||||
|
|
||||||
if (!readOnly && node.kind == 'block') {
|
if (!readOnly) {
|
||||||
style = {
|
style = {
|
||||||
display: 'block',
|
|
||||||
height: '0',
|
height: '0',
|
||||||
color: 'transparent'
|
color: 'transparent'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!readOnly && node.kind == 'inline') {
|
|
||||||
style = {
|
|
||||||
color: 'transparent'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.debug('render', { props })
|
this.debug('render', { props })
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@@ -24,9 +24,11 @@ export const state = (
|
|||||||
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 data-slate-void="true">
|
<div data-slate-void="true">
|
||||||
<span style="display:inline-block;vertical-align:top;width:0;height:0;color:transparent">
|
<div style="height:0;color:transparent">
|
||||||
|
<span>
|
||||||
<span></span>
|
<span></span>
|
||||||
</span>
|
</span>
|
||||||
|
</div>
|
||||||
<div contenteditable="false">
|
<div contenteditable="false">
|
||||||
<img src="https://example.com/image.png">
|
<img src="https://example.com/image.png">
|
||||||
</div>
|
</div>
|
||||||
|
@@ -32,9 +32,11 @@ export const output = `
|
|||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<span data-slate-void="true">
|
<span data-slate-void="true">
|
||||||
<span style="color:transparent">
|
<span style="height:0;color:transparent">
|
||||||
|
<span>
|
||||||
<span></span>
|
<span></span>
|
||||||
</span>
|
</span>
|
||||||
|
</span>
|
||||||
<span contenteditable="false">
|
<span contenteditable="false">
|
||||||
<img>
|
<img>
|
||||||
</span>
|
</span>
|
||||||
|
Reference in New Issue
Block a user