1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-08-29 18:09:49 +02:00

fix block void node handling, closes #358

This commit is contained in:
Ian Storm Taylor
2016-09-26 21:42:25 -07:00
parent e63a6b36ce
commit 071d7292b8

View File

@@ -67,8 +67,7 @@ class Void extends React.Component {
// Make the outer wrapper relative, so the spacer can overlay it. // Make the outer wrapper relative, so the spacer can overlay it.
const style = { const style = {
position: 'relative', position: 'relative'
lineHeight: '0px'
} }
return ( return (
@@ -91,11 +90,33 @@ class Void extends React.Component {
*/ */
renderSpacer = () => { renderSpacer = () => {
const style = { const { node } = this.props
position: 'relative', let style
top: '0px',
left: '-9999px', if (node.kind == 'block') {
textIndent: '-9999px', style = IS_FIREFOX
? {
pointerEvents: 'none',
width: '0px',
height: '0px',
lineHeight: '0px',
visibility: 'hidden'
}
: {
position: 'absolute',
top: '0px',
left: '-9999px',
textIndent: '-9999px'
}
} else {
style = {
position: 'relative',
top: '0px',
left: '-9999px',
height: '0px',
width: '0px',
textIndent: '-9999px',
}
} }
return ( return (