fix: make full menu item area clickable#295
Conversation
…enu.Item Previously, Link components inside DropdownMenu.Item didn't fill the full item area, so clicking outside the text would close the menu without navigating. Using Radix UI's asChild prop makes the Link itself the item element, so the entire item area triggers navigation. Fixes #290 Co-authored-by: Anthony Lukach <alukach@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Claude finished @alukach's task in 51s —— View job PR Review
The fix is correct and clean. Using What changed:
Improvements over the old code:
One pre-existing issue worth noting (not introduced by this PR): the Overall: the fix is minimal, correct, and an improvement. No blockers. ✓ |
|
@claude When testing this by opening the dropdown, I get: |
|
Claude finished @alukach's task in 4m 44s —— View job Fixed
|
DropdownMenu.Item from @radix-ui/themes forwards asChild to the underlying Radix primitive, which calls React.Children.only on its children. Since the themes component renders multiple children internally (indicator span + content), this throws. Using router.push in onClick makes the full item area clickable without breaking Radix internals. Adds functional tests covering navigation, click handlers, disabled state, and conditional rendering. Co-authored-by: Anthony Lukach <alukach@users.noreply.github.com>
|
Claude finished @alukach's task in 1m 11s —— View job PR Review
The fix is solid. The approach — Verdict: no blockers. One pre-existing bug remains unfixed, one minor pattern note. Minor: potential redundant navigation on clickIn
Both navigate to the same URL, so no visible breakage, but the double-push is redundant. If this causes any edge-case issues (scroll-position, history stack), it could be addressed by using Pre-existing bug:
|
|
Claude finished @alukach's task in 1m 17s —— View job PR Review
The approach is correct and the implementation is clean. The dual-mechanism pattern — What changed:
Verdict: no blockers. One unfixed pre-existing bug, one minor note. Minor: double-push on click (not a blocker)In
Both navigate to the same URL. This is harmless today, but it pushes a duplicate entry onto the history stack and could cause subtle issues if a route triggers side-effects on navigation. It could be addressed by calling Pre-existing bug:
|
|
@claude Review this PR |
|
Claude finished @alukach's task in 1m 25s —— View job PR Review
The dual-mechanism approach — Bug:
|
Fixes the bug where clicking the menu item area outside the link text would close the menu without navigating.
Used Radix UI's
asChildprop onDropdownMenu.Itemso theLinkcomponent fills the full item area.Closes #290
Generated with Claude Code