Clearing input model for typeahead on blur does not work if results list is present
See original GitHub issueBug description:
- Trying to clear the input model programmatically on blur event does not work if the result window is present and results are showing
Link to minimally-working plunker that reproduces the issue:
http://plnkr.co/edit/XSJLmqnPei2ZObg3KVIT?p=preview
- In search type
lkjhsdfsdf
and blur, notice the text clears correctly - In search type ‘ma’ and notice results are present. Blur the input and notice the text stays in the input
The same issue happens if you try to set the value of the input directly as well.
Version of Angular, ng-bootstrap, and Bootstrap:
Angular: 4.0.1
ng-bootstrap: 1.0.0-alpha.22
Bootstrap: 4.0.0-alpha.6
Issue Analytics
- State:
- Created 6 years ago
- Reactions:8
- Comments:10 (2 by maintainers)
Top Results From Across the Web
Angular ngbTypeahead doesn't reset value of input on blur
Show activity on this post. I'm using the bootstrap ngbTypeahead of Angular2+ and I want to clean the input when lose focus and...
Read more >AutoComplete - PrimeNG - PrimeFaces
When present, autocomplete clears the manual input if it does not match of the suggestions to force only accepting values from the suggestions....
Read more ><input>: The Input (Form Input) element - HTML
A Boolean attribute which, if present, indicates that the user should not be able to interact with the input. Disabled inputs are typically ......
Read more >Directives > mdAutocomplete - AngularJS Material
Parameter Type Description
md‑search‑text expression expression A model to bind the search query text to.
md‑selected‑item object object A model to bind the selected item...
Read more >C# tutorial on autocomplete and suggestions - Azure
Add autocomplete and suggestions to collect search term input from users ... UI library to present the dropdown list of suggested results.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@pflugs30 I assume given the time you’ve already found away around this, but if not, I solved the same problem as you by writing a custom directive
One issue I see to the fix that deeg put for review is that it sets the input to null instead of the
[(ngModel)]
if one was previously selected.Perhaps modifying the dismissPopup function would be a better option:
Here is a plunker I forked from yours: http://plnkr.co/edit/XIVlMJ8V0iUcC0npUfwG?p=preview