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

YSP-352: Mobile menu hide animation on resize #340

Merged
merged 4 commits into from
Mar 13, 2024

Conversation

dblanken-yale
Copy link
Contributor

@dblanken-yale dblanken-yale commented Feb 27, 2024

YSP-352: Mobile menu hide animation on resize

When resizing the window to a mobile size, the closed menu actually shows temporarily and then animates up to hide itself.

A loaded menu state is one where the page has been loaded, but no toggles have been made. This lets us take that into account and not display the visual rollup on a resize.

Description of work

  • Add loaded initial menu state so that we can properly hide the menu on initial resize
  • On window resize, set the state to loaded if it was closed

Testing Link(s)

Functional Review Steps

  • Resize the loaded page to a mobile menu size
  • Verify you don't see the mobile menu roll up after resizing
  • Click the expand button
  • Click the collapse button
  • Resize outside of mobile menu size
  • Resize back to mobile menu size
  • Verify that you do not see the mobile menu roll up after resizing
  • Expand the menu button
  • Resize and make sure the open state still works when going mobile

Accessibility Review

  • Verify the component meets Accessibility requirements

A loaded menu state is one where the page has been loaded, but no
toggles have been made.  This lets us take that into account and not
display the visual rollup on a resize.
Copy link

netlify bot commented Feb 27, 2024

Deploy Preview for dev-component-library-twig ready!

Name Link
🔨 Latest commit d11fd78
🔍 Latest deploy log https://app.netlify.com/sites/dev-component-library-twig/deploys/65f1aef5468e960008c68d46
😎 Deploy Preview https://deploy-preview-340--dev-component-library-twig.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

The svg arrows were showing even though the menu was not.  They no
longer show.
If we resize the window again and the current state of the menu is
closed, make it loaded so we don't get the roll up effect afterward.  If
it's open, leave it as is.
@dblanken-yale dblanken-yale marked this pull request as ready for review February 27, 2024 20:18
Copy link
Contributor

@joetower joetower left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dblanken-yale This all looks good and accomplishes the goal. I can not think of a better way to do this nor can I think of any downsides to your approach here.

Lovely work!

@dblanken-yale
Copy link
Contributor Author

@joetower Thanks so much. I added @kara-franco then to make sure there's no accessibility issues doing this or that she finds some way to get into the menu that I can't find. :D

Copy link

@kara-franco kara-franco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice! Works as expected and no keyboard traps!

@nJim nJim merged commit cae66fa into develop Mar 13, 2024
1 check passed
@nJim nJim deleted the YSP-313-mobile-menu-animation-bug branch March 13, 2024 13:50
@vinmassaro vinmassaro mentioned this pull request Mar 22, 2024
Copy link

🎉 This PR is included in version 1.40.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants