Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix nav flicker that happens on window resize #16232

Merged
merged 1 commit into from
Oct 17, 2024

Conversation

trevorbayless
Copy link
Member

@trevorbayless trevorbayless commented Oct 16, 2024

Fixes the navigation hamburger menu flicker that happens on window resize. The issue is transition: transform 200ms; always being applied when the layout changes. Changed to add the transition selectively when the menu is opened/closed.

The approach in this PR keeps all transitions as is. The new opened class cannot be simply toggled as we need to wait long enough for the transition to finish (for the close transition), hence the setTimeout call on menu close. I felt this was the most straightforward approach that maintains compatibility as listening to when a transitioned event completes seems to be browser specific.

Solves the problem seen here:

2024-10-16.15-50-28.mp4

@ornicar ornicar merged commit 1755068 into lichess-org:master Oct 17, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants