fix(tag-dropdown): arrow navigation for submenu affecting text input cursor#1121
fix(tag-dropdown): arrow navigation for submenu affecting text input cursor#1121icecrasher321 merged 1 commit intostagingfrom
Conversation
There was a problem hiding this comment.
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
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
Testing
Manually. Keep tag dropdown open and text navigation with arrow keys should still work.
Checklist