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: ensure DonorDashboard mobile navigation opens as expected #7560

Merged
merged 3 commits into from
Oct 11, 2024

Conversation

JoshuaHungDinh
Copy link
Contributor

@JoshuaHungDinh JoshuaHungDinh commented Oct 3, 2024

Resolves: GIVE-1288

Description

This PR resolves an issue with the mobile navigation in the DonorDashboard where the hamburger menu was unresponsive, preventing donors from accessing other sections of the dashboard on mobile devices.

The problem stemmed from a handleClick function inside a useEffect hook, which unintentionally caused the menu to close immediately upon interaction, preventing it from staying open when clicked.

Affects

The DonorDashboard in mobile view.

Visuals

Screen.Recording.2024-10-03.at.8.59.04.AM.mov

Testing Instructions

  • Open the donor dashboard in mobile view.
  • Click the hamburger menu/icon to open the navigation items.
  • Click outside the navigation links to verify the menu closes.
  • Navigate to a new page to ensure the menu works properly.

Pre-review Checklist

  • Acceptance criteria satisfied and marked in related issue
  • Relevant @unreleased tags included in DocBlocks
  • Includes unit tests
  • Reviewed by the designer (if follows a design)
  • Self Review of code and UX completed

Copy link
Contributor

@pauloiankoski pauloiankoski left a comment

Choose a reason for hiding this comment

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

@JoshuaHungDinh This solution indeed works as expected, opening the menu. However, I’d like to propose a different approach that would allow us to benefit from auto-closing the menu when clicking on one of the options.

The steps would be:

  • Rename contentRef to toggleRef throughout the code.
  • Move the existing ref attribute to the .give-donor-dashboard-mobile-menu__toggle element.

By doing this, everything should work as expected without needing to use stopPropagation.

@JoshuaHungDinh
Copy link
Contributor Author

@JoshuaHungDinh This solution indeed works as expected, opening the menu. However, I’d like to propose a different approach that would allow us to benefit from auto-closing the menu when clicking on one of the options.

The steps would be:

  • Rename contentRef to toggleRef throughout the code.
  • Move the existing ref attribute to the .give-donor-dashboard-mobile-menu__toggle element.

By doing this, everything should work as expected without needing to use stopPropagation.

@pauloiankoski Resolved: 1f41cb0

Copy link
Member

@rickalday rickalday left a comment

Choose a reason for hiding this comment

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

Passed manual QA tests.

@JoshuaHungDinh JoshuaHungDinh merged commit 39721a4 into develop Oct 11, 2024
18 of 20 checks passed
@JoshuaHungDinh JoshuaHungDinh deleted the fix/donordashboard-mobile-menu-remains-closed branch October 11, 2024 21:46
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.

3 participants