Skip to content

Commit

Permalink
Fix unrecognised forwardedRef prop (#8570)
Browse files Browse the repository at this point in the history
* Fix iframe JavaScript indendation

* Fix unrecognised `forwardedRef` prop error

Have `withGlobalEvents` omit the `forwardedRef` prop. This prevents the
prop being added to HTML in some cases, e.g. when used in
`FocusableIframe`.
  • Loading branch information
noisysocks authored Aug 7, 2018
1 parent d54396c commit 98274f0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/components/src/sandbox/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ class Sandbox extends Component {
// keeping the correct aspect ratio.
var potentialIframe = document.body.children[0];
if ( 'DIV' === potentialIframe.tagName || 'SPAN' === potentialIframe.tagName ) {
potentialIframe = potentialIframe.children[0];
}
potentialIframe = potentialIframe.children[0];
}
if ( potentialIframe && 'IFRAME' === potentialIframe.tagName ) {
if ( potentialIframe.width ) {
iframe = potentialIframe;
Expand Down
4 changes: 2 additions & 2 deletions packages/compose/src/with-global-events/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ function withGlobalEvents( eventTypesToHandlers ) {
}

render() {
return <WrappedComponent { ...this.props } ref={ this.handleRef } />;
return <WrappedComponent { ...this.props.ownProps } ref={ this.handleRef } />;
}
}

return forwardRef( ( props, ref ) => {
return <Wrapper { ...props } forwardedRef={ ref } />;
return <Wrapper ownProps={ props } forwardedRef={ ref } />;
} );
}, 'withGlobalEvents' );
}
Expand Down

0 comments on commit 98274f0

Please sign in to comment.