This repository was archived by the owner on Sep 5, 2024. It is now read-only.
fix(autocomplete): autocompletes input should not clear the view value. #8977
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
md-input-maxlength
and the limit as reached, the ngModelCtrl will clear the$viewValue
, which causes theinput to keep the entered text, but the autocomplete already knows that the searchText is empty.
@ThomasBurleson Please read this before reviewing:
Carlos had a concern, that the autocomplete's behavior will break, since the
autocomplete
did only emit thesearchTextChange
event if it's valid.I had a discussion with @robertmesserle about the concerns of @clshortfuse.
We both agreed that the documentation mentions clearly that the
searchTextChange
will be emitted always (regardless of validity of the searchText)The developers should be able to always track the
searchText
.Another concern was, that the
autocomplete
currently only queries for results, if thesearchText
is valid (this is not mentioned / stated in the documentation).The autocomplete should always query for the results (regardless of the validity of the
searchText
).Developers can easily reduce the amount of queries, by just modifying their
queryFn
.Something to consider is, whether this change should have any special announcement in the
changelog
or not.Fixes #8947.