Skip to content

fix(AutoComplete): improve keyboard navigation and accessibility#1919

Open
pranjali2076 wants to merge 2 commits intoRocketChat:mainfrom
pranjali2076:main
Open

fix(AutoComplete): improve keyboard navigation and accessibility#1919
pranjali2076 wants to merge 2 commits intoRocketChat:mainfrom
pranjali2076:main

Conversation

@pranjali2076
Copy link
Copy Markdown

What does this PR do?

Improves keyboard accessibility of the AutoComplete component.

Changes

  • Backspace removes last selected tag when input is empty
  • Enter key now selects correct matching item (fixes stale cursor)
  • Partial text match highlights correct option using includes()
  • Fixed stale cursor index reset in useCursor hook

Related Issues

Closes #1567

Tests

  • Added new test for Backspace key functionality
  • All 19 tests passing ✅

WCAG Compliance

Improves WCAG 2.1 SC 2.1.1 keyboard accessibility

- Add Backspace key to remove last selected tag when input is empty
- Fix stale cursor causing Enter to select wrong item
- Sync cursor with initial index using useEffect in useCursor
- Use includes() for partial match highlighting

Fixes keyboard-only users unable to remove tags without mouse
Improves WCAG 2.1 SC 2.1.1 keyboard accessibility compliance
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 30, 2026

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 30, 2026

⚠️ No Changeset found

Latest commit: 2f2cc8f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

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.

AutoComplete placeholder input and input clear problem

2 participants