Description
Bug, feature request, or proposal:
Bug
What is the expected behavior?
When the options are updated and the selected option is no longer available the selected option should be cleared.
When using enter to open the Md-Select options there should be no error
What is the current behavior?
The selected option is hold on to, although NgModel is null and the options no longer has the selected option available.
After that, when opening the Md-Select options dialog an error occurs: 'unable to get property focus of undefined or null reference'
What are the steps to reproduce?
http://plnkr.co/edit/USEs6VII79YJA7dnh31g?p=preview
Steps:
- Choose option 1 on first select: selectedValue1 = 1
- Choose option 2 on second select: selectedValue2 = 2
- Choose option 2 on first select: selectedValue1 = 2, selectedValue2 = null
- Option 2 remains 'selected' on second select
What is the use-case or motivation for changing an existing behavior?
Which versions of Angular, Material, OS, browsers are affected?
Is there anything else we should know?
Callstack:
"TypeError: Unable to get property 'focus' of undefined or null reference
at ListKeyManager.prototype.setFocus (eval code:4573:9)
at MdSelect.prototype._focusCorrectOption (eval code:5106:13)
at MdSelect.prototype._onPanelDone (eval code:5007:13)
at View_MdSelect2.prototype.handleEvent_1 (Function code:459:5)