mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-29 09:59:48 +02:00
fix block void node handling, closes #358
This commit is contained in:
@@ -67,8 +67,7 @@ class Void extends React.Component {
|
||||
|
||||
// Make the outer wrapper relative, so the spacer can overlay it.
|
||||
const style = {
|
||||
position: 'relative',
|
||||
lineHeight: '0px'
|
||||
position: 'relative'
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -91,11 +90,33 @@ class Void extends React.Component {
|
||||
*/
|
||||
|
||||
renderSpacer = () => {
|
||||
const style = {
|
||||
position: 'relative',
|
||||
top: '0px',
|
||||
left: '-9999px',
|
||||
textIndent: '-9999px',
|
||||
const { node } = this.props
|
||||
let style
|
||||
|
||||
if (node.kind == 'block') {
|
||||
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 (
|
||||
|
Reference in New Issue
Block a user