fix: allow clicking the dropdown caret icon in Autocomplete - #16610
fix: allow clicking the dropdown caret icon in Autocomplete#16610mojidev7 wants to merge 1 commit into
Conversation
The CaretSortIcon (and its shortcut-badge wrapper) is absolutely positioned on top of the trigger Button but isn't a descendant of it, so pointer events landed on the icon never reached the Button/ PopoverTrigger click handler. This made dropdowns built on Autocomplete (e.g. the medication request frequency dropdown) impossible to open by clicking directly on the arrow icon, even though clicking the rest of the field worked fine. Adding pointer-events-none to the icon/wrapper lets clicks pass through to the underlying trigger, consistent with how the icon is already handled in other dropdown-style components in this codebase (select.tsx, dialog.tsx, etc.). Fixes ohcnetwork#16609
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
WalkthroughThe autocomplete caret icons now ignore pointer events across mobile and desktop renderings, including desktop shortcut and standalone caret variants. No props or exported declarations changed. ChangesAutocomplete caret interaction
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🚀 Preview Deployment Ready!🔗 Preview URL: https://pr-16610.care-preview-a7w.pages.dev 📱 Mobile Access: This preview will be automatically updated when you push new commits to this PR. |
nihal467
left a comment
There was a problem hiding this comment.
- the lint is failing , fix it
- add before and after fix screenshot or video
🎭 Playwright Test ResultsStatus: ❌ Failed
📊 Detailed results are available in the playwright-final-report artifact. Run: #10489 |
Description
Fixes #16609.
The
CaretSortIcon(dropdown arrow) in the sharedAutocompletecomponent is absolutely positioned on top of the triggerButton, but it is rendered as a sibling of thePopover/Drawer, not as a descendant of theButtonitself. Because of that, clicks landing directly on the icon never reach theButtonclick handling, so dropdowns built onAutocomplete(e.g. the medication request frequency dropdown) could not be opened by clicking the arrow icon, even though clicking elsewhere on the field worked fine.This affects both the desktop (
Popover) and mobile (Drawer) branches ofAutocomplete, including theshortcutIdbadge variant.Fix
Add
pointer-events-noneto the icon (and its wrapper, for the shortcut-badge case) so clicks pass through to the underlying trigger button instead of being swallowed by the icon element. This matches how equivalent icons are already handled elsewhere in the codebase (e.g.select.tsx,dialog.tsx).Testing
pointer-events-noneis an established Tailwind utility already used acrosssrc/components/ui/*in this codebase.Screenshots
Not attached, this is a click-target fix with no visual change (icon appearance and position are unchanged, only its click-through behavior changes).
Summary by CodeRabbit