javascriptangularjs

Typeahead need to press enter,


I am very new to Angular. When I search for something a dropdown appears and after clicking the dropdown list, I have to press enter again to make the dropdown work.

    <div class="input-append input-group" style="padding-right: 25px;width: 100%;">
        <input id="inputActionTextBox" type="text" ng-model="asyncSelected"
               typeahead="action as action for action in getActionNames($viewValue)"
               class="form-control"
               placeholder="Search by Action Name or Description"
               ng-enter="stepInputEnterPressed('fromNameSearch')" ng-model-options="{debounce: 500}"  
               ng-keyup="keyPress($event.keyCode, $viewValue)" ng-dblclick="changeHandler()"
               style="font-style:italic; outline: none; width: 100%;"/>
    </div>

Basicaly I need to call this function when user clicks any of the dropdown list stepInputEnterPressed('fromNameSearch')


Solution

  • Can you try using ng-click instead of ng-dblclick.