NgbTypeahead keyboard accessibility: scrolling by keyboard takes focus out of view
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- angular, bootstrap, typescript
- Domain
- accessibility, frontend
Research direction
Start with the StackBlitz reproduction, especially src/app/typeahead-basic.html and the styling for NgbTypeaheadWindow in index.html. Compare the Simple Typeahead example with the component's keyboard navigation and highlight handling. Done means the highlighted result remains visible while moving with the arrow keys in a constrained, scrollable result list.
Written by the indexing model from the issue text.
Description
Bug description:
This may be considered to be outside the purpose for which it was intended, but for my project we're using NgbTypeahead to return all matching entries while limiting the height of the NgbTypeaheadWindow and displaying a vertical scrollbar on it. This works fine for a mouse and a screenreader, but not for a sighted keyboard user because the control doesn't scroll the continents to keep the highlighted item within the container viewport. Maybe calling scrollIntoView() on the element receiving the highlight would make this work?
Link to minimally-working StackBlitz that reproduces the issue:
https://stackblitz.com/edit/angular-bwbfv3rd?file=src%2Fapp%2Ftypeahead-basic.html
This is forked from https://ng-bootstrap.github.io/#/components/typeahead/examples, which is the code behind the Simple Typeahead example in the documentation at https://ng-bootstrap.github.io/#/components/typeahead/examples. It adds styling to the ngb-typeahead-window in index.html to constrain the height of the box to 6.5rem, enough to display three entries.
To observe the problem, type "ar" into the input field. More than three entries are returned for the query, so a scrollbar appears next to the first three results. Scrolling the list by mouse works as expected. But pressing the Down-arrow key causes the highlight to move out of view, even though the navigation is happening, as can be demonstrated by pressing the Up-arrow key as many times as the Down-arrow key was pressed and observing that the highlight comes back into view.
Versions of Angular, ng-bootstrap and Bootstrap:
Angular: 18.0.7
ng-bootstrap: 17.0.1
Bootstrap: not explicitly included in package.json, don't know
- Dominant language
- TypeScript
- Stars
- 8.2k
- Forks
- 1.6k
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ng-bootstrap/ng-bootstrap
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
ng-bootstrap/ng-bootstrap#4926 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
ng-bootstrap/ng-bootstrap#4925 ·
-
Difficulty 1/5 1-3 hours Newbie friendliness 82/100
ng-bootstrap/ng-bootstrap#4923 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
ng-bootstrap/ng-bootstrap#4903 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
ng-bootstrap/ng-bootstrap#4929 ·
All issues in ng-bootstrap/ng-bootstrap
Similar issues
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 76/100
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
vercel/react-tweet#225 ·