Skip to content

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

Open
lukasedw wants to merge 1 commit into
rubycdp:mainfrom
lukasedw:top-layer-ignores-ancestor-opacity
Open

lukasedw wants to merge 1 commit into
rubycdp:mainfrom
lukasedw:top-layer-ignores-ancestor-opacity

Conversation

@lukasedw

Copy link
Copy Markdown

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
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.

1 participant