Skip to content

Preserve generated option IDs when navigating backwards - #119

Merged
liuliu-dev merged 1 commit into
github:mainfrom
feritcemkahraman:fix-backwards-generated-option-ids
Oct 15, 2026
Merged

liuliu-dev merged 1 commit into
github:mainfrom
feritcemkahraman:fix-backwards-generated-option-ids

Conversation

@feritcemkahraman

Copy link
Copy Markdown
Contributor

For options without IDs, pressing ArrowDown twice and then ArrowUp leaves aria-activedescendant pointing at an ID that no longer exists. The previous option still owns the generated ID when the new option is processed.

Clear the previous selection before assigning the new option's ID, using the existing cleanup method. This also removes the duplicated cleanup loop.

The Chromium regression fails before the fix and passes after it. All 28 tests from the repository's browser suite pass in an isolated Mocha/Chai Chromium harness; existing ID and collision controls are included. TypeScript compilation and ESLint pass using compatible tools from a sibling checkout. Karma and Firefox/WebKit were not run.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The localized cleanup change fixes the reported defect and includes targeted regression coverage.

0 open findings

What changed in this PR

Fixes backward combobox navigation so generated option IDs remain synchronized with aria-activedescendant.

Changes:

  • Clears the previous selection before assigning the next option’s ID.
  • Reuses existing cleanup logic and removes the duplicated loop.
  • Adds a backward-navigation regression test.
File Description
test/​test.js Verifies generated IDs follow backward selection.
src/​index.ts Clears selection before assigning the target ID.

🧠 Review effort: Max


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@liuliu-dev
liuliu-dev merged commit 39831c8 into github:main Oct 15, 2026
4 checks passed
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.

3 participants