Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

typeahead invalid if model is set manually #3318

Closed
jengeb opened this issue Feb 20, 2015 · 0 comments
Closed

typeahead invalid if model is set manually #3318

jengeb opened this issue Feb 20, 2015 · 0 comments

Comments

@jengeb
Copy link
Contributor

jengeb commented Feb 20, 2015

I use typeahead for finding movies. If a searched movie (e.g., The Big Lebowski) is not in the list, I use a modal to insert this movie and to select the just inserted movie in the typeahead-input-field. Here simulated with "Set model". After this selection the input-field is marked as invalid.

The problem of invalidity occurs if you type some text in the input field and then click "Set model". If the input field is untouched or initially marked as valid (because the just searched movie "Matrix" was in the list) and you "Set model" afterwards, the form is valid too.

Please look at the described example in this plnkr:
http://plnkr.co/edit/EUOYKIZu6oizcEXTQ3UH?p=preview

@wesleycho wesleycho added this to the 0.13.0 milestone Mar 23, 2015
@karianna karianna removed the PRs plz! label Mar 23, 2015
ayakovlevgh pushed a commit to ayakovlevgh/bootstrap that referenced this issue Mar 24, 2015
With this commit, the validity of a typeahead model is set to true if
the model is set manually and the typehead directive is set to be
non-editable.

add test for setting model manually

Fixes angular-ui#3318
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants