Re: [csswg-drafts] [css-anchor-1] Need ability to say "don't render" when anchor is off-screen (#7758)

I've coded my tooltips to be a psuedo top-layer, so they break through their anchor's boundary. For example, this is anchor to the button, but overlays above the Nav Drawer and its scrollbar on the left:

![image](https://github.com/w3c/csswg-drafts/assets/9271155/8771381c-d452-44a4-9d21-c63571459f58)

I can simulate a clip by dropping the z-index:

![image](https://github.com/w3c/csswg-drafts/assets/9271155/0fd5a75f-c8b6-48b3-a25c-563e958ad28c)

An example of "don't render" because the anchor is off-screen is applicable to what I call "semi-sticky" toolbars, where it scrolls aways on scroll down, but stickied on scroll up. If the keyboard is focused on a toolbar button, the tooltip is shown. But when the toolbar button is no longer more than 50%, then it meets my custom threshold of being "off-screen" and I close the tooltip. 

![image](https://github.com/w3c/csswg-drafts/assets/9271155/edefb476-a710-4934-8f7a-2e6e180a8925)

And mid-hide when scrolling down:

![image](https://github.com/w3c/csswg-drafts/assets/9271155/2837797f-28d1-4ee0-a8d8-504508f0766f)

The consequence of not doing this is the issue we know where a tooltip can appear when it shouldn't:

![image](https://github.com/w3c/csswg-drafts/assets/9271155/196ff405-14be-4308-a980-76b8b0df818f)

I'm using intersection observer on the anchor as well as on the tooltip itself. Because the tooltip isn't useful without what it's giving a tip for, I want it on the anchor. But there could be an instance where the tooltip gets occluded (eg: forced position) and then I want it to hide instead of reposition when partially occluded.

I'm unsure what `anchor-clip` means here. Is it when the anchor (eg: the button) is clipped? Or do we mean to clip the tooltip? Is my terminology wrong? Is "anchor" the button or tooltip here?



-- 
GitHub Notification of comment by clshortfuse
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7758#issuecomment-1643996688 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 20 July 2023 14:08:54 UTC