Skip to content

fix: allow clicking the dropdown caret icon in Autocomplete - #16610

Open
mojidev7 wants to merge 1 commit into
ohcnetwork:developfrom
mojidev7:fix/dosage-frequency-caret-click
Open

fix: allow clicking the dropdown caret icon in Autocomplete#16610
mojidev7 wants to merge 1 commit into
ohcnetwork:developfrom
mojidev7:fix/dosage-frequency-caret-click

Conversation

@mojidev7

@mojidev7 mojidev7 commented Jul 29, 2026

Copy link
Copy Markdown

Description

Fixes #16609.

The CaretSortIcon (dropdown arrow) in the shared Autocomplete component is absolutely positioned on top of the trigger Button, but it is rendered as a sibling of the Popover/Drawer, not as a descendant of the Button itself. Because of that, clicks landing directly on the icon never reach the Button click handling, so dropdowns built on Autocomplete (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 of Autocomplete, including the shortcutId badge variant.

Fix

Add pointer-events-none to 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

  • Verified pointer-events-none is an established Tailwind utility already used across src/components/ui/* in this codebase.
  • Change is scoped to className additions only, no structural or behavioral changes to component logic.

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

  • Bug Fixes
    • Improved autocomplete interaction by ensuring caret icons do not intercept clicks or pointer events.
    • Preserved existing autocomplete behavior and controls.

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
@mojidev7
mojidev7 requested review from a team July 29, 2026 17:56
@github-actions

Copy link
Copy Markdown

⚠️ Merge Checklist Incomplete

Thank you for your contribution! To help us review your PR efficiently, please complete the merge checklist in your PR description.

Your PR will be reviewed once you have marked the appropriate checklist items.

To update the checklist:

  • Change - [ ] to - [x] for completed items
  • Only check items that are relevant to your PR
  • Leave items unchecked if they don't apply

The checklist helps ensure code quality, testing coverage, and documentation are properly addressed.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: ecc3b2a8-6282-4df4-a45c-e1a04550da6c

📥 Commits

Reviewing files that changed from the base of the PR and between c560786 and fc758a1.

📒 Files selected for processing (1)
  • src/components/ui/autocomplete.tsx

Walkthrough

The 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.

Changes

Autocomplete caret interaction

Layer / File(s) Summary
Disable caret pointer events
src/components/ui/autocomplete.tsx
Mobile and desktop caret renderings now include pointer-events-none; the desktop shortcut wrapper also ignores pointer events.

Suggested reviewers: amjithtitus09, jacobjeevan

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: making the Autocomplete caret behave correctly when clicked.
Description check ✅ Passed The description explains the bug, fix, testing, and screenshots, but it does not follow the repository template exactly.
Linked Issues check ✅ Passed The change addresses issue #16609 by letting clicks on the caret pass through to the Autocomplete trigger.
Out of Scope Changes check ✅ Passed The diff is narrowly scoped to pointer-events class additions and introduces no unrelated changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

🚀 Preview Deployment Ready!

🔗 Preview URL: https://pr-16610.care-preview-a7w.pages.dev

📱 Mobile Access:
Scan the QR code below to open the preview on your mobile device.

QR Code


This preview will be automatically updated when you push new commits to this PR.

@nihal467 nihal467 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

  • the lint is failing , fix it
  • add before and after fix screenshot or video

@github-actions

Copy link
Copy Markdown

🎭 Playwright Test Results

Status: ❌ Failed
Test Shards: 3

Metric Count
Total Tests 334
✅ Passed 333
❌ Failed 1
⏭️ Skipped 0

📊 Detailed results are available in the playwright-final-report artifact.

Run: #10489

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot click the arrow icon of medication request's frequency dropdown

2 participants