Skip to content

Ignore ancestor opacity for open popovers and modal dialogs - #328

Merged
route merged 1 commit into
rubycdp:mainfrom
lukasedw:top-layer-ignores-ancestor-opacity
Oct 13, 2026
Merged

route merged 1 commit into
rubycdp:mainfrom
lukasedw:top-layer-ignores-ancestor-opacity

Conversation

@lukasedw

Copy link
Copy Markdown
Contributor

Problem

isVisible walks every ancestor of a node and reports hidden if any of them has display: none, visibility: hidden or opacity: 0. A popover or a modal <dialog> renders in the top layer once shown, so it's actually on screen even under an opacity: 0 ancestor, but isVisible still reports it hidden:

<div style="opacity: 0"><div id="menu" popover>menu</div></div>
page.execute_script("document.getElementById('menu').showPopover()")
expect(page).to have_css("#menu") # fails; the menu is on screen

Fix

Ancestor opacity stops applying past an open popover or a modal dialog, since they render in the top layer; the display and visibility checks are unchanged.

Testing

Three specs under Node#visible. The first two fail on main; the third is a guard that already passes. Suite and rubocop pass.

@lukasedw
lukasedw force-pushed the top-layer-ignores-ancestor-opacity branch from aba98ed to ff99f3d Compare September 29, 2026 00:33
@route
route merged commit e2709b1 into rubycdp:main Oct 13, 2026
7 checks passed
@route

route commented Oct 13, 2026

Copy link
Copy Markdown
Member

Thanks!

route added a commit that referenced this pull request Oct 13, 2026
* ref(js): match top-layer selectors in a single call

* test(visible): cover a child of a shown popover under opacity: 0

* docs(changelog): add popover visibility fix and point Unreleased link to cuprite
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants