mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-02-01 21:52:44 +01:00
fix void blocks to node be inline-block, closes #1210
This commit is contained in:
parent
e0d7122881
commit
c36362a425
@ -138,18 +138,7 @@ class Void extends React.Component {
|
||||
render() {
|
||||
const { props } = this
|
||||
const { children, node } = props
|
||||
let Tag, style
|
||||
|
||||
if (node.kind === 'block') {
|
||||
Tag = 'div'
|
||||
style = {
|
||||
display: 'inline-block',
|
||||
verticalAlign: 'top',
|
||||
width: '100%'
|
||||
}
|
||||
} else {
|
||||
Tag = 'span'
|
||||
}
|
||||
const Tag = node.kind == 'block' ? 'div' : 'span'
|
||||
|
||||
this.debug('render', { props })
|
||||
|
||||
@ -162,7 +151,7 @@ class Void extends React.Component {
|
||||
onDrop={this.onDrop}
|
||||
>
|
||||
{this.renderSpacer()}
|
||||
<Tag contentEditable={this.state.editable} style={style}>
|
||||
<Tag contentEditable={this.state.editable}>
|
||||
{children}
|
||||
</Tag>
|
||||
</Tag>
|
||||
@ -187,6 +176,7 @@ class Void extends React.Component {
|
||||
display: 'inline-block',
|
||||
verticalAlign: 'top',
|
||||
width: '0',
|
||||
height: '0',
|
||||
color: 'transparent'
|
||||
}
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user