Skip to content

Commit bc02fa1

Browse files
authored
Correctly deal with string numbers
Fixes #162
1 parent 60098f2 commit bc02fa1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/text-fragment-utils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -547,8 +547,8 @@ const isNodeVisible =
547547
const nodeStyle = window.getComputedStyle(elt);
548548
// If the node is not rendered, just skip it.
549549
if (nodeStyle.visibility === 'hidden' || nodeStyle.display === 'none' ||
550-
nodeStyle.height === 0 || nodeStyle.width === 0 ||
551-
nodeStyle.opacity === 0) {
550+
parseInt(nodeStyle.height, 10) === 0 || parseInt(nodeStyle.width, 10) === 0 ||
551+
parseInt(nodeStyle.opacity, 10) === 0) {
552552
return false;
553553
}
554554
}

0 commit comments

Comments
 (0)