I am using the ng-tags tags-input like this:
<tags-input ng-model="Tags" placeholder="Add" add-from-autocomplete-only="true">
<auto-complete source="loadTags($query)"></auto-complete>
</tags-input>
I want any leftover text to disappear when the tags-input field loses control. I wanted to use the allowLeftoverText attribute to achieve this but the documentation says its ignored when the addFromAutocompleteOnly is used.
Any text left in the input element will remain there until the user removes it herself. The allowLeftoverText
function is to mark the element as invalid when there is some leftover text so you can show some error message to the user.
And that option isn't ignored when addFromAutocompleteOnly
is true. The documentation was outdated, but it has been fixed already.
Version 3.0 introduced a way to change the input value programmatically. This is how leftover text can be accessed (Note- ng-blur would remove the leftover text):
<tags-input ng-model="tags" text="textVar" ng-blur="textVar=''"></tags-input>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With