Angularjs typeahead not displaying the options on 2nd input focus
Asked Answered
S

0

6

I have a dropdown control and a txt input control which is bound to typeahead control. Initially when I'll display category

enter image description here

As soon as I get to the input box for filtering and the control gets the focus I'm able to get the results:

enter image description here

As a next step I'll change the filter value to Priority

enter image description here

But when I click the input textbox nothing happens until I'll enter some value and clear it, please check the gif at this url https://i.gyazo.com/d95937ade5b9c05ec3adf169c7533d50.mp4

The input textbox has this markup :

<input name="states" ng-trim="false" id="states" type="text" placeholder="Start Filtering..." ng-model="selected" typeahead-editable="false" uib-typeahead="state for state in states | filter:$viewValue | limitTo:8" class="form-control" typeahead-on-select="onSelect($item, $model, $label)" typeahead-min-length="0">
Specs answered 4/12, 2018 at 17:20 Comment(3)
To help you out I would more information, can you add some more code. But for the instance can you try to add $scope.$apply() in the ngchange callback of filterMonikamoniker
I don't find any issue in the code which you have provided. The state data is getting undefined after changing the filter value. Check once if you are getting $scope.states value after changing the filter or not. Put the debugger or try to print in html itself by {{state}}.Endometrium
it would be way easier to answer if you could provide a code snippet , like in stackblitz.com, but for now set a watch to the model and see in console what happens to it when you are using your inputsHedva

© 2022 - 2024 — McMap. All rights reserved.