-
Notifications
You must be signed in to change notification settings - Fork 779
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(is-visible-on-screen): ignore elements hidden by overflow:hidden #3676
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly done, wrapping up for the day though.
ancestors.push(vNode); | ||
} | ||
|
||
return ancestors.concat(getOverflowHiddenNodes(vNode.parent)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double points for the clean recursion 😄.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple minor points
test/commons/math/rects-touch.js
Outdated
|
||
let rectA, rectB; | ||
beforeEach(() => { | ||
rectA = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not strictly necessary, but you could consider using DOMRect in these tests. (I only learned of these a week ago, otherwise I might've used them in target-size stuff.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a bad idea. If the tests were more complicated I might consider that, but since it's a simple test I'll just leave it as is.
This also fixes a bug in
svg-non-empty-title
that was discovered by this change in that it usedvisibleVirtual
to get the title text.title
elements aren't visible so it should instead usesubtreeText
and allow hidden elements.For the previous
overflowHidden
function, I found that it was added to handle a screen reader only styling. I made sure the code still works with the new functionality.Closes issue: #3247 and #2806