Closed
Description
Bug, feature request, or proposal:
The actions emitted by the panelClosingActions are not consistent
What is the expected behavior?
All actions should be typed as MdOptionSelectionChange according to the type signature of the field.
What is the current behavior?
Depending on how the panel is closed, the following actions are emitted:
- Tabbing out to close panel =>
panelClosingActions
emits anundefined
- Clicking outside panel =>
panelClosingActions
emits aMouseEvent
- If the form value was cleared and an option is clicked=>
panelClosingActions
emitsMdOptionSelectionChange
- If the form value was not cleared and an option is clicked =>
panelClosingActions
does not emit a value - The first time an option is selected with
Enter
press =>panelClosingActions
emitsMdOptionSelectionChange
- Subsequent times an option is selected with
Enter
press =>panelClosingActions
does not emit a value - Closing panel with
Esc
=>panelClosingActions
does not emit a value (Although this might have been fixed by fix(autocomplete): emit closing action for escape keydown event #6250)
What are the steps to reproduce?
https://plnkr.co/edit/FjX9XJD6NkxddNtRLngb?p=preview
What is the use-case or motivation for changing an existing behavior?
This inconsistency makes it very hard to actually use panelClosingActions as a reliable source for the actual value selected.
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Angular 4.4.3, Material2 beta.11, Chrome, Windows