I am using an input field of type number
with a list of suggestions defined as a datalist
.
Internet Explorer 11 and Microsoft Edge do not trigger the change event, once a suggestion is picked from the list. Neither the ng-model
will update, nor will ng-change
be triggered. It works fine in other browsers, though.
<input type="number" list="suggestions" ng-model="selectedValue" />
<datalist id="suggestions">
<option value="0.5"></option>
<option value="1"></option>
<option value="1.5"></option>
<option value="2"></option>
</datalist>
{{ selectedValue | json }}
Microsoft's browsers behave differently: One of them will update the model, when user clicks outside of the input field and it looses focus. The other browser will not trigger a change event at all. Entering values manually (by keyboard, not selecting a suggestion) will always update the model.
Is there anything I can do about that? Either a workaround, or, maybe am I using it wrong?