components icon indicating copy to clipboard operation
components copied to clipboard

MatAutocompleteTrigger panelClosingActions have inconsistent types.

Open iblocks-Xander opened this issue 9 years ago • 1 comments

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:

  1. Tabbing out to close panel => panelClosingActions emits an undefined
  2. Clicking outside panel => panelClosingActions emits a MouseEvent
  3. If the form value was cleared and an option is clicked=> panelClosingActions emits MdOptionSelectionChange
  4. If the form value was not cleared and an option is clicked => panelClosingActions does not emit a value
  5. The first time an option is selected with Enter press => panelClosingActions emits MdOptionSelectionChange
  6. Subsequent times an option is selected with Enter press => panelClosingActions does not emit a value
  7. Closing panel with Esc => panelClosingActions does not emit a value (Although this might have been fixed by https://github.com/angular/material2/pull/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

iblocks-Xander avatar Oct 05 '17 15:10 iblocks-Xander

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.