Skip to content

[amp-lightbox] lightbox inside a fixed element does not work on iOS/embed case #9576

@aghassemi

Description

@aghassemi

to repro, run the following locally and use DevTools to emulate iPhone, not that lightbox does not open.

    <style amp-custom>
      .amp-lightbox {
        background: black;
      }

      .fixed {
        position: fixed;
        background: yellow;
        top: 0;
        height: 100px;
      }

      amp-lightbox {
        background: grey;
      }
    </style>
  </head>
  <body>
    <div class="fixed">
      Header
      <button on="tap:lightbox">Open Lighbox</button>
      <amp-lightbox id="lightbox" layout="nodisplay">LIGHTBOX</amp-lightbox>
    </div>
  </body>

Issues is enterLightboxMode more hides the fixed layer but lightbox is inside the fixed layer because its parent was fixed and moved to the fixed layer.

@dvoytenko Only solution I can think of is not to hide the fixed layer if lightbox itself is in the fixed layer. Do you think that would work?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions