I would like to let users to clear selecting but on the same time restrict choice to options from predictions. When clearing input using backspace onBlur listener reselects last selection on line 135:
if ($scope.forceSelection) { $scope.selected = ($scope.selected === -1) ? 0 : $scope.selected; }
Input can be safely cleared by selecting whole input with for example ctrl-a and pressing backspace/delete. In such case first check ($scope.predictions.length === 0) in onBlur returns true and input gets cleared.
It seems that when input gets cleared predictions should also get cleared.
I would like to let users to clear selecting but on the same time restrict choice to options from predictions. When clearing input using backspace onBlur listener reselects last selection on line 135:
if ($scope.forceSelection) { $scope.selected = ($scope.selected === -1) ? 0 : $scope.selected; }
Input can be safely cleared by selecting whole input with for example ctrl-a and pressing backspace/delete. In such case first check($scope.predictions.length === 0)
in onBlur returns true and input gets cleared.It seems that when input gets cleared predictions should also get cleared.