diff --git a/lib/components/void.js b/lib/components/void.js index 655067a4b..f595e00b2 100644 --- a/lib/components/void.js +++ b/lib/components/void.js @@ -21,6 +21,10 @@ class Void extends React.Component { style: React.PropTypes.object }; + static defaultProps = { + style: {} + } + shouldComponentUpdate = (props) => { return ( props.node != this.props.node || @@ -34,20 +38,18 @@ class Void extends React.Component { const Tag = node.kind == 'block' ? 'div' : 'span' // Make the outer wrapper relative, so the spacer can overlay it. - const relative = { + const styles = { + ...style, position: 'relative' } return ( - + {this.renderSpacer()} {children} diff --git a/test/rendering/fixtures/custom-block-void/index.js b/test/rendering/fixtures/custom-block-void/index.js index e508818c3..2b92a949b 100644 --- a/test/rendering/fixtures/custom-block-void/index.js +++ b/test/rendering/fixtures/custom-block-void/index.js @@ -1,8 +1,13 @@ +import { Void } from '../../../..' import React from 'react' function Image(props) { - return + return ( + + + + ) } export function renderNode(node) { diff --git a/test/rendering/fixtures/custom-block-void/output.html b/test/rendering/fixtures/custom-block-void/output.html index 591712d02..f31b16fd0 100644 --- a/test/rendering/fixtures/custom-block-void/output.html +++ b/test/rendering/fixtures/custom-block-void/output.html @@ -1,13 +1,15 @@
-
- - -
+
+
+ + +
+
- -
- +
+ +
diff --git a/test/rendering/index.js b/test/rendering/index.js index a14d7b336..9696da82e 100644 --- a/test/rendering/index.js +++ b/test/rendering/index.js @@ -54,7 +54,7 @@ function clean(html) { $(el).removeAttr('data-offset-key') }) - $('[contenteditable]').removeAttr('style') + $.root().children().removeAttr('style') return $.html() }