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

clearing a typeahead doesn't work when it's typeahead-editable="false" #1620

Closed
jnizet opened this issue Jan 20, 2014 · 4 comments
Closed

clearing a typeahead doesn't work when it's typeahead-editable="false" #1620

jnizet opened this issue Jan 20, 2014 · 4 comments

Comments

@jnizet
Copy link

jnizet commented Jan 20, 2014

I think I found a small bug a typeahead. When I try to clear the typeahead (by setting its model to undefined), it works fine if the typeahead is editable, but it doesn't if it's not editable (i.e. its typeahead-editable attribute is false).

The bug is illustrated, with an ugly workaround, in this plunkr

@pkozlowski-opensource
Copy link
Member

Yes, it looks like we need to do better here!

@ghost
Copy link

ghost commented May 21, 2014

I agree that this would be a very welcome fix.

@futurechan
Copy link

I'm having some trouble with this too. It sets my model to an empty string when I clear the input.

This seems to work for me:

$scope.$watch('typeaheadModel', function(newValue){
    if(newValue == '')
        delete $scope.typeaheadModel;
})

@huguangju
Copy link

@futurechan it's doesn‘t work for me

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants