mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-18 21:21:21 +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'
|
||||
let style
|
||||
|
||||
if (!readOnly && node.kind == 'block') {
|
||||
if (!readOnly) {
|
||||
style = {
|
||||
display: 'block',
|
||||
height: '0',
|
||||
color: 'transparent'
|
||||
}
|
||||
}
|
||||
|
||||
if (!readOnly && node.kind == 'inline') {
|
||||
style = {
|
||||
color: 'transparent'
|
||||
}
|
||||
}
|
||||
|
||||
this.debug('render', { props })
|
||||
|
||||
return (
|
||||
|
@@ -24,9 +24,11 @@ export const state = (
|
||||
export const output = `
|
||||
<div data-slate-editor="true" contenteditable="true" role="textbox">
|
||||
<div data-slate-void="true">
|
||||
<span style="display:inline-block;vertical-align:top;width:0;height:0;color:transparent">
|
||||
<span></span>
|
||||
</span>
|
||||
<div style="height:0;color:transparent">
|
||||
<span>
|
||||
<span></span>
|
||||
</span>
|
||||
</div>
|
||||
<div contenteditable="false">
|
||||
<img src="https://example.com/image.png">
|
||||
</div>
|
||||
|
@@ -32,8 +32,10 @@ export const output = `
|
||||
</span>
|
||||
</span>
|
||||
<span data-slate-void="true">
|
||||
<span style="color:transparent">
|
||||
<span></span>
|
||||
<span style="height:0;color:transparent">
|
||||
<span>
|
||||
<span></span>
|
||||
</span>
|
||||
</span>
|
||||
<span contenteditable="false">
|
||||
<img>
|
||||
|
Reference in New Issue
Block a user