[6.x] Fix mobile nav button failing#14673
Open
jaygeorge wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the Problem
If you pull the window in so the nav switches to a burger state, it sometimes fails to function on page load.
The nav talked to the sidebar through
Statamic.$events, which was flagged as flaky (click/timing races, especially on mobile), and the drawer could flash on screen before JS added the right classes.Nav.Failing.mp4
What this PR Does
To be honest, I think this nav should be a popover, which would be less fragile and drastically simplify things – but that's probably an even bigger change, and something to consider in future if we start changing the component.
You can see the behaviour is fixed now:
Nav.Working.mp4
How to Reproduce