[DOM] `hide` middleware `referenceHidden` incorrect when reference ancestor is `position: absolute`
See original GitHub issueFor the following HTML structure, hide middleware return true
, indicate that reference element been hided.
Event though its parent is overflow:hidden
and computed style height: 0
, actually position: absolute
make it related with outer relatived ancestor.
<div style="position: relative;">
<div style="overflow: hidden; border: 4px solid green;">
<div style="position: absolute;">
<div id="reference"></div>
</div>
<div id="floating">Floating element</div>
</div>
</div>
sandbox: https://codesandbox.io/s/mutable-browser-euniq7?file=/src/index.js:318-369

Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:9 (1 by maintainers)
Top Results From Across the Web
Using position:absolute, the nearest positioned ancestor is ...
Two general rules to keep in mind: An absolutely positioned element will be positioned within its containing block, which is defined by the ......
Read more >computePosition
This is an async function that computes and returns x and y coordinates to position a floating element next to a reference element....
Read more >How to make absolute positioned elements overlap their ...
Anyway, here our main problem is that the relative parent is also the overflow:hidden one. Well, if we simply move the position rule...
Read more >UDN Search
the grid inspector allows you to examine css grid layouts using the firefox devtools, discovering grids present on a page, examining and modifying...
Read more >position - CSS: Cascading Style Sheets - MDN Web Docs
Note that a sticky element "sticks" to its nearest ancestor that has a "scrolling mechanism" (created when overflow is hidden , scroll ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Rip, did feel like there would be more complex cases to handle than the few tests I wrote. 😞
In the Sandbox I see it’s been edited so that the reference element has
position: absolute
instead of the ancestor which fixes the issue.Probably need to check every ancestor between the reference element and its clipping ancestor and see if any of them
absolute
?