1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-26 00:27:28 +02:00

Set the display ccs property of the void inline wrappers to inline-block.

Update tests.
This commit is contained in:
Raffaele De Feo
2017-02-07 15:06:37 +01:00
parent d44f7e2122
commit 4f439ab3ca
2 changed files with 13 additions and 4 deletions

View File

@@ -86,11 +86,20 @@ class Void extends React.Component {
render = () => {
const { props } = this
const { children, node } = props
const Tag = node.kind == 'block' ? 'div' : 'span'
let Tag, style
// Make the outer wrapper relative, so the spacer can overlay it.
const style = {
position: 'relative'
if (node.kind === 'block') {
Tag = 'div'
style = {
position: 'relative'
}
} else {
Tag = 'span'
style = {
display: 'inline-block',
position: 'relative'
}
}
this.debug('render', { props })

View File

@@ -6,7 +6,7 @@
<span data-slate-zero-width="true">&#x200B;</span>
</span>
</span>
<span data-slate-void="true" style="position:relative;">
<span data-slate-void="true" style="display:inline-block;position:relative;">
<span style="position:relative;top:0px;left:-9999px;text-indent:-9999px;">
<span>
<span data-slate-zero-width="true">&#x200B;</span>