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: dismiss overflow dropdown on anchor click #460

Merged
merged 1 commit into from
Dec 9, 2021

Conversation

dstaley
Copy link
Contributor

@dstaley dstaley commented Dec 7, 2021

🎟️ Asana Task
πŸ” Preview Link


Description

This extends the behavior added in #426 to the MenuItemsOverflow component, which is used on mobile devices.

PR Checklist πŸš€

Items in this checklist may not may not apply to your PR, but please consider each item carefully.

  • Add Asana and Preview links above.
  • Conduct thorough self-review.
  • Add or update tests as appropriate.
  • Conduct reasonable cross browser testing for both compatibility and responsive behavior (We have a Sauce Labs account for this, if you don't have access, just ask!).
  • Conduct reasonable accessibility review (use the WAS as a guide or an axe browser plugin until we establish more formal checks).
  • Identify (in the description above) and document (add Asana tasks on this board) any technical debt that you're aware of, but are not addressing as part of this PR.

@vercel
Copy link

vercel bot commented Dec 7, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

πŸ” Inspect: https://vercel.com/hashicorp/react-components/2cypwKjpME8H6zBsoWxge5ZDoESx
βœ… Preview: https://react-components-git-dsdismiss-subnav-dropdown-d27c09-hashicorp.vercel.app

@changeset-bot
Copy link

changeset-bot bot commented Dec 7, 2021

πŸ¦‹ Changeset detected

Latest commit: b51d0cf

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@hashicorp/react-subnav Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

@alexcarpenter alexcarpenter left a comment

Choose a reason for hiding this comment

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

πŸ‘πŸΌ

@dstaley dstaley merged commit 77b4b71 into main Dec 9, 2021
@dstaley dstaley deleted the ds.dismiss-subnav-dropdown-overflow branch December 9, 2021 19:01
@github-actions github-actions bot mentioned this pull request Dec 9, 2021
@alexcarpenter
Copy link
Contributor

@dstaley I think I found a bug where menus are not closing on click. In the use case that we pass a next/link to the link prop in subnav. event.target.tagName is not equal to 'A'?

import Link from 'next/link'

<Subnav Link={Link} />

@dstaley
Copy link
Contributor Author

dstaley commented Dec 10, 2021

Hmm, I'm not seeing that behavior on the terraform-website-next site.

It might be a better idea for us to use a router hook and listen for navigation events rather than detecting clicks.

@alexcarpenter
Copy link
Contributor

@dstaley Check out this preview here https://cloud-hashicorp-com-msy3mvgid-hashicorp.vercel.app/products/vault

Toggle between products in the primary nav.

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