New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[amp-fit-text:1.0] Use ResizeObserver for content changes #28496
Conversation
Ok. This looks super simple. Even simpler than before. But does this work? |
I tested with resizing the dimensions on the container by modifying the computed dimensions from the Chrome Developer Tools. I also tested with resizing the contents by appending and removing text nodes in the DOM. I did this in both the AMP example document and the Preact Storybook sample. :) Is there anything else you think would be useful here? |
This sounds awesome. The only confirmation I'm really looking for is a test like this:
|
Here is what I did:
It appears that the style modification in (2) does not cause a record on the I then moved the Finally I set However both before and after the inclusion of Perhaps even worse, it appears to be inconsistently firing when toggling the tldr; We can only modify to the extent that we can consistently reproduce (1) and (2) in your manual test confirmation but not (3). |
Note: This feature also addresses some a11y implications: #29556 |
Updated some merge conflicts with the |
…#28496) * Observe measurerRef * Set and observe a nested `contentRef` div with `height: min-content` * Move `height: min-content` to css * Use `ContainWrapper` preset refs * Place in css file
Instead of
useEffect
forchildren
prop. Partial for #28281