ampproject / ampproject/amphtml

amp-lightbox should reset its stacking context when it opens.

Open
#21,959 2 comments 0 reactions 0 assignees View on GitHub
Component: amp-lightbox P3: When Possible Stale Type: Bug Type: DevX WG: components
Dominant language
JavaScript
Stars
14.9k
Forks
4.1k
PR merge metrics
No merged PRs in 30d

Description

We missed enforcing `amp-lightbox` to be a child of `body` like we did `amp-sidebar`, now depending on where in DOM developers add `amp-lightbox` they may run into stacking context issues like https://github.com/ampproject/amphtml/issues/21777 .

We should either move `amp-lightbox` to body before opening or have it reset the stacking context when opened and set it back when closed.

This can be done by adding
```
-amp-lightbox-ancestor {
z-index: auto;
position: static;
opacity: 1;
transform: none;
-webkit-filter: none;
perspective: none;
transform-style: flat;
-webkit-mask: none !important;
transition: none !important;
-webkit-overflow-scrolling: auto;
}
```
to all ancestors.

Contributor guide

Open the contributing guide

Research direction

Start by locating the amp-lightbox implementation and compare its open/close behavior with amp-sidebar, which the issue names as the precedent. Reproduce the stacking-context case from issue 21777, then verify that opening and closing amp-lightbox handles the listed ancestor styles without regressions.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.