Container query stops working when changing DOM
See original GitHub issueIt seems that under some specific circumstances, changes in DOM either aren’t detected or for some other reason, the generated class is not reattached to @container
-affected elements.
It seems that two container queries are needed to reproduce the issue.
Minimal example: https://jsfiddle.net/edt3b1Lz/
After clicking on Render A
, .a
’s container query stops working until the container is resized.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:7
Top Results From Across the Web
Responsive Components: a Solution to the Container Queries ...
I've found the best way to handle this is to inline your container query code at the end of your HTML templates, so...
Read more >Container queries begin to land in stable browsers while the ...
"Container queries enable components to own their responsive styling information based on the space they fit within.
Read more >A Primer On CSS Container Queries - Smashing Magazine
Let's look at what problem is being solved, learn how container queries work, and see how they compare with and complement existing CSS ......
Read more >Container Query Discussion | CSS-Tricks
The final reason I question the need for container queries is that a change in layout sometimes requires a change in behavior, too....
Read more >Web Components support? · Issue #7 - GitHub
attachShadow() seems to work well, however, the biggest hurdle I am running into is that the CSS_Object_Model does not have the CSSContainerRule yet....
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
Are there any updates on this?
This issue should be fixed by the newest version of the polyfill (currently in alpha). Please give it a try and let me know if you run into any further issues.
Thank you!