bug(MatSelect): When navigating with keyboard, sometimes the first press of the down arrow is "ignored"
- Dominant language
- TypeScript
- Stars
- 25k
- Forks
- 6.8k
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 91
Description
#### Reproduction
The value of the first `MatOption` in a `MatSelect` must be `null`. Example:
```
-- // <------- Here
Dog
Cat
```
- https://stackblitz.com/edit/angular-lyemh3?file=src%2Fapp%2Fselect-hint-error-example.html
Steps to reproduce:
1. Refresh development server
2. Tab to the `MatSelect`
2. Use the down arrow to make a selection
3. Notice that the very first press appears to be ignored
#### Expected Behavior
The first press of the arrow should select `Dog`.
#### Actual Behavior
The first press of the arrow appears to do nothing.
#### Environment
- Angular: 11.0.6
- CDK/Material: 11.0.3
- Browser(s): Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): Windows
Contributor guide
Research direction
Start by reproducing the behavior in the linked StackBlitz with a MatSelect whose first MatOption has a null value, then trace the MatSelect keyboard-navigation path. Done means the first Down Arrow press selects Dog rather than appearing ignored, with a regression test covering this case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angular, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100