From 071d7292b8a4a953ff26e76554732cd8da6bf87d Mon Sep 17 00:00:00 2001 From: Ian Storm Taylor Date: Mon, 26 Sep 2016 21:42:25 -0700 Subject: [PATCH] fix block void node handling, closes #358 --- src/components/void.js | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/src/components/void.js b/src/components/void.js index a9a1fd250..e390ea752 100644 --- a/src/components/void.js +++ b/src/components/void.js @@ -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 (