oddbird/css-anchor-positioning

Can I load this in a custom-element, so it can access shadow-dom?

herrKlein opened this issue · 1 comments

Hi, really nice polyfill.

I would like the example which keeps the container in the viewport. I have 2 questions.
Does it work with shadowdom. I would like to use it for a custom dropdown component where the popup has to stay inside the window.

Second question is, I see the example constantly updating when it overlaps the border of the scrollable content. Wouldn't that make it slow. Is that a bug?

Screenshot 2024-04-22 at 11 30 53

Does it work with shadowdom. I would like to use it for a custom dropdown component where the popup has to stay inside the window.

That's a great question, and my answer is honestly "I'm not sure." We paused development on this polyfill to allow the spec to stabilize (see comment here), and I don't think we've tested with custom components yet. If you have time to test that out, please report back!

Second question is, I see the example constantly updating when it overlaps the border of the scrollable content. Wouldn't that make it slow. Is that a bug?

Yes, that certainly looks like a bug to me. Would you be willing to open a new issue?