Skip to content

Commit

Permalink
add existential check to replace
Browse files Browse the repository at this point in the history
  • Loading branch information
jennifer-shehane committed Nov 8, 2024
1 parent b229d5f commit be5587c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/driver/src/dom/visibility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ const isStrictlyHidden = (el, methodName = 'isStrictlyHidden()', options = { che
// the presence of text content that is not just
// spaces or newlines should make the element visible
// since you can see the text with your eyes
if (el.textContent.replace(whitespaceRegex, '')) {
if (el.textContent?.replace(whitespaceRegex, '')) {
// unless it is explicitly hidden in some way
return hasExplicitNonVisibleProps($el, options)
}
Expand Down

0 comments on commit be5587c

Please sign in to comment.