Skip to content

isUserInput == false when cycling through closed select #5084

@willshowell

Description

@willshowell

Bug, feature request, or proposal:

Bug

Expected behavior

When cycling through options in a closed select with the up and down keys, I'd expect the MdOptionSelectionChange to have isUserInput == true

Current behavior

isUserInput is only true when selected from an open select.

Reproduction

http://plnkr.co/edit/YQn77sSXj60cNwLYldOC?p=preview

What is the use-case or motivation for changing an existing behavior?

I want to trigger an event when the user

  1. Opens the select and changes the value with mouse or keyboard
  2. Opens the select and reselects the current value mouse or keyboard
  3. Cycles to a new option while the select is closed

It's easy to achieve 1 and 3 with the the select's (change) event. In order to get 2, I have to instead watch each option's (onSelectionChange) event and filter by event.source.selected. At this point, I cannot tell the difference between changes made by the ControlValueAccessor interface or by the user cycling through the closed select.

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Latest (c2816ef)

Is there anything else we should know?

I may be misinterpreting the use of isUserInput but it would seem that cycling through a closed select would be considered "selection coming from the user".

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions