-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Description
Is this a regression?
- Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
No response
Description
KeyboardEvent#keyCode
is deprecated, but the Select component key bindings are only defined according to keyCode
, not KeyboardEvent#key
or KeyboardEvent#code
. In our use case we wish to test that the default SPACE key event handling is carried out by the Select component, given that we are overriding the keydown event handler for other keys. However we cannot trigger the event handler in the test by dispatching a KeyboardEvent without the "SPACE" keyCode present on the event. Ideally we should be able to pass an event with the key
property for SPACE instead.
Reproduction
StackBlitz not relevant
Expected Behavior
Dispatching a KeyboardEvent with key: " "
should trigger the default MatSelect keydown handler behaviour for a space key press.
Actual Behavior
This does not happen unless the event also has keyCode: 32
defined.
Environment
- Angular: 19.0.0
- CDK/Material: 19.0.0
- Browser(s): Google Chrome 140.0.7339.80 (Official Build) (64-bit)
- Operating System (e.g. Windows, macOS, Ubuntu): Linux