Skip to content

fix(tag-dropdown): arrow navigation for submenu affecting text input cursor#1121

Merged
icecrasher321 merged 1 commit intostagingfrom
fix/tag-dropdown-arrows
Aug 23, 2025
Merged

fix(tag-dropdown): arrow navigation for submenu affecting text input cursor#1121
icecrasher321 merged 1 commit intostagingfrom
fix/tag-dropdown-arrows

Conversation

@icecrasher321
Copy link
Collaborator

Summary

Prevent Default in arrow right breaking text input behaviour. This PR finds intuitive way to navigate submenu when open with arrows while maintaining text navigation.

Type of Change

  • Bug fix

Testing

Manually. Keep tag dropdown open and text navigation with arrow keys should still work.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Aug 23, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
sim Ready Ready Preview Comment Aug 23, 2025 11:16pm
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
docs Skipped Skipped Aug 23, 2025 11:16pm

@icecrasher321 icecrasher321 merged commit 5786909 into staging Aug 23, 2025
5 checks passed
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Summary

This PR addresses a UX issue in the tag dropdown component where arrow key navigation was interfering with normal text cursor movement. The problem occurred because the ArrowRight keydown handler always called preventDefault(), which blocked users from moving their cursor within the input field when the dropdown was visible.

The solution introduces a canEnterSubmenuForSelected() helper function that intelligently determines whether the currently selected dropdown item has an available submenu to enter. The ArrowRight handler now only prevents default behavior when there's actually a submenu action available, allowing normal text navigation to occur when no submenu exists.

This change maintains the existing submenu navigation functionality while restoring the expected text editing behavior. The fix is particularly important since the tag dropdown remains open while users type, making cursor navigation within the input field essential for a good user experience. The implementation follows the codebase pattern of using helper functions to extract conditional logic, keeping the main event handler clean and readable.

Confidence score: 4/5

  • This PR is safe to merge with minimal risk as it only affects keyboard navigation behavior in a specific UI component
  • Score reflects well-structured code changes that preserve existing functionality while fixing a clear UX issue
  • Pay close attention to the keyboard event handling logic in the tag dropdown component

1 file reviewed, no comments

Edit Code Review Bot Settings | Greptile

@waleedlatif1 waleedlatif1 deleted the fix/tag-dropdown-arrows branch August 24, 2025 08:02
arenadeveloper02 pushed a commit to arenadeveloper02/p2-sim that referenced this pull request Sep 19, 2025
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.

1 participant