ampproject / ampproject/amphtml
AMP-lightbox with a nested iframe can't be opened multiple times
- Dominant language
- JavaScript
- Stars
- 14.9k
- Forks
- 4.1k
- PR merge metrics
- No merged PRs in 30d
Description
### Description
When nesting an AMP-iframe inside an AMP-lightbox, the lightbox render properly with the iframe when triggered.
However after I close the lightbox and re-open it - the lightbox gets a minimal height (i.e. it's not showing).
When I tried doing the same thing with version 0.1 of AMP-lightbox, the lightbox didn't load at all, and I got a message error "layoutcomplete race"
example: https://site.ampify.io/sites/amp-lightbox/index.html
### Reproduction Steps
1. Open https://site.ampify.io/sites/amp-lightbox/index.html
2. click to open the light box
3. close the lightbox
4. click to open it again
### Relevant Logs
_No response_
### Browser(s) Affected
Chrome
### OS(s) Affected
_No response_
### Device(s) Affected
_No response_
### AMP Version Affected
_No response_
Contributor guide
Research direction
Reproduce the behavior at https://site.ampify.io/sites/amp-lightbox/index.html by opening and closing the lightbox, then opening it again; compare this with AMP-lightbox 0.1 and the reported "layoutcomplete race" error. Trace the AMP-lightbox and nested AMP-iframe lifecycle, and consider the issue done when repeated openings render the iframe at the expected height without that error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100