Skip to content

feature: Added accessible, responsive, page-based game dropdown menu#137

Merged
Crustaly merged 3 commits intomainfrom
feature/accessible-game-dropdown-v2
Apr 24, 2025
Merged

feature: Added accessible, responsive, page-based game dropdown menu#137
Crustaly merged 3 commits intomainfrom
feature/accessible-game-dropdown-v2

Conversation

@jschhie
Copy link
Copy Markdown
Collaborator

@jschhie jschhie commented Apr 23, 2025

Problem

  • The Game Zone page previously offered only static filter buttons for each game type, with no dropdown menu for linked games.
  • This limited discoverability and accessibility for keyboard and screen reader users.
  • On smaller viewports, game card titles overlapped with the mobile navbar.

Approach

  • Added toggleable dropdown menus for linked Language and Math games, based on the current page.
  • Implemented hover and toggle logic to show/hide dropdowns.
  • Tracked reactive flags (isLangMenuOpen and isMathMenuOpen) to control visibility and dynamically update aria-expanded for screen readers.
  • Each dropdown menu is:
    • Keyboard accessible (Tab and Enter supported)
    • Dynamically styled based on toggle state and currentPage
    • Fully responsive across screen sizes
  • Fixed mobile overlap issue by setting z-index: 0 in GameZoneCard.vue.
  • Added extra UX improvements:
    • Handled @blur / @focusout events to automatically close open dropdowns and reset menu button styling.
    • Re-clicking a selected menu button now toggles its dropdown closed.

Responsive Dropdown Menu Demos

Demos below show the accessible dropdown menus styled and functional across screen sizes.
Blue ring = currently focused option (via click, Tab, or Enter).

Viewport Demo Image
Mobile (xs, sm)
Mobile view, unopened dropdown menuMobile view, opened dropdown menu
Tablet (md)
Tablet view
Desktop (lg)
Desktop view

Additional Notes

  • My initial implementation is available in the feature/accessible-game-dropdown-menus branch.
  • It included two dropdowns on the same page, but lacked blur handling and did not retain the original game page buttons.
  • The original PR #130 for this implementation has been closed.

jschhie added 2 commits April 23, 2025 14:57
Readded button filters. Added page-based dropdown with blur/focus handling. Improved keyboard nav, dynamic aria support, and RWD. Merged latest main.
Readded button filters. Added page-based dropdown with blur/focus handling. Improved keyboard nav, dynamic aria support, and RWD. Merged latest main.
@jschhie jschhie added feature New feature or request accessibility This issue needs to be resolved for ADA compliance labels Apr 23, 2025
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 23, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
audemywebsite ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 24, 2025 2:09am

@jschhie jschhie marked this pull request as ready for review April 23, 2025 23:58
@master-of-none master-of-none requested review from Crustaly and master-of-none and removed request for master-of-none and rajat-k1 April 24, 2025 00:01
Copy link
Copy Markdown
Owner

@Crustaly Crustaly left a comment

Choose a reason for hiding this comment

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

looks great!

@Crustaly Crustaly merged commit 82f0bba into main Apr 24, 2025
5 checks passed
@master-of-none master-of-none deleted the feature/accessible-game-dropdown-v2 branch April 25, 2025 18:51
@jschhie jschhie self-assigned this Jul 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accessibility This issue needs to be resolved for ADA compliance feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants