Twitter bento component does not resize properly
See original GitHub issueDescription
The Twitter bento component does not resize properly when the page is scrolled fast. The embed shows the unexpanded state with an expand button. In both cases, the Tweet embed will appear unbuilt when it is first scrolled into view. This indicates the intersection observer needs to be tweaked for lazy construction of the embed. This issue occurs only for the amp-twitter-1.0 version the amp-twitter-0.1 works as expected check this example for reference.
Reproduction Steps
Open https://bento-twitter-intersection-observer-issue.glitch.me URL and scroll quickly to the Twitter embed the embed should appear in non expanded state.
Relevant Logs
Uncaught (in promise) Error: changeSize attempt denied
at Object.callback (mutator-impl.js:79)
at Pj (resources-impl.js:927)
at h (resources-impl.js:1642)
at Gj.setState (finite-state-machine.js:53)
at Ij.g.doPass (resources-impl.js:643)
at resources-impl.js:538
at Ll (vsync-impl.js:456)
at Hl.g.Bh (vsync-impl.js:413)
Browser(s) Affected
No response
OS(s) Affected
No response
Device(s) Affected
No response
AMP Version Affected
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:15 (15 by maintainers)
Top Results From Across the Web
Introducing the Bento component library | bentojs.dev
Bento components provide wrappers for common third party embeds that are properly sandboxed and implement performance best practices such as ...
Read more >I2I: Create a component to display Tiktok posts #32219 - GitHub
Summary This component will consist of a Tiktok embed, which is a single video file loaded through an iframe. A TikTok video URL...
Read more >How to Resize Pictures Properly for Twitter - Alphr
1. Open the online image converter. 2. Drag your photo into the blank box or upload it from your computer. 3. Find the...
Read more >Akaki Khotcholava (@khotcholava9) / Twitter
Jetbrains is a company which offers a variety of IDEs and tools to developers for ... Encapsulate logic properly into an #Angular component...
Read more >How can I make my wistia video player / playlist responsive?
Right now, videoFoam isn't dialed in for playlists - I know it is something Max wants to go back and work on, but...
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
I wonder if we can somehow hack this. When the embed is out of view we could initially style the actual twitter embed as
position: fixed; opacity: 0; pointer-events: none
. From the embed’s perspective, this might trick it into believing it’s in viewport and trigger the resize events. Once we get a resize event, or the container comes into view, we can revert toposition: static
.@alanorozco Thanks for your suggestion I have created a PR https://github.com/ampproject/amphtml/pull/37740 with your mentioned workaround with this the embed now gets resized as soon as the component gets built when shown below the fold. Can you review and provide any necessary feedback.