Skip to content

Commit

Permalink
Fixed instanceOf HTMLElement to work across contexts (#968)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Alzetta authored and bvaughn committed Jan 14, 2018
1 parent 2dcc9d4 commit 533920e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion source/CellMeasurer/CellMeasurer.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@ export default class CellMeasurer extends React.PureComponent<Props> {

// TODO Check for a bad combination of fixedWidth and missing numeric width or vice versa with height

if (node instanceof HTMLElement) {
if (
node &&
node.ownerDocument &&
node.ownerDocument.defaultView &&
node instanceof node.ownerDocument.defaultView.HTMLElement
) {
const styleWidth = node.style.width;
const styleHeight = node.style.height;

Expand Down

0 comments on commit 533920e

Please sign in to comment.