ampproject / ampproject/amphtml

amp-mega-menu occasionally fails to render

Open
#31,452 6 comments 0 reactions 1 assignee Claimed by @samouri View on GitHub
Component: amp-mega-menu Stale Type: Bug WG: components WG: performance
Dominant language
JavaScript
Stars
14.9k
Forks
4.1k
PR merge metrics
No merged PRs in 30d

Description

## What's the issue?

The amp-mega-menu parent header tag's class sometimes erroneously does not get the "i-amphtml-mega-menu-mask-parent" class. This may be a race condition.

I have been able to increase the rate of failure by using "display: flex", but it does not appear to be specifically related to that CSS property.

No workaround appears to exist.

## How do we reproduce the issue?

A min-reproducible test case is available on jsbin: https://jsbin.com/ripahibuza/edit?html,output

Refresh multiple times to see two different rendered outcomes:

Observed, expected:
![image](https://user-images.githubusercontent.com/435158/101225466-5bc24100-3646-11eb-9639-d4619d34e0d1.png)

Observed, erroneous:
![image](https://user-images.githubusercontent.com/435158/101225452-549b3300-3646-11eb-8701-915434bb928d.png)

## What browsers are affected?

This min-reproducible has been tested against the latest Chrome 86 on Windows 10. The issue has been observed in other environments as well.

## Which AMP version is affected?

This does not appear to be a regression. It may make sense to review #27454 when resolving this issue.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.