Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Tagging without multiple, with enter as trigger, broken in 0.12.0 #983

Open
karptonite opened this issue Jun 2, 2015 · 3 comments
Open

Comments

@karptonite
Copy link

See this plunkr for an example. Triggering a new tag with a comma works, but not enter.

http://plnkr.co/edit/DrkSbSdhjGU3cmdIXGVH?p=preview

If you switch to the previous version of ui-select, the bug disappears.

The bug is only for tagging without multiples.

@kshutkin
Copy link
Contributor

kshutkin commented Jun 8, 2015

As a workaround you can use tagging-label="false". Anyway labels are not working right now for single select mode. Hope this #972 will help to fix it.

@emmanueldaher
Copy link

+1

@shaparau
Copy link

shaparau commented Nov 8, 2017

as another alternative, you can manage the array of items via "refresh" function, e.g.
define refresh="refreshItems($select)" and

`$scope.refreshItems = function (selectObject) {
if (selectObject.search) {
if (selectObject.items.length === 0) {
selectObject.items.push($scope.newItem(selectObject.search));
} else if (selectObject.items.length === 1 && selectObject.items[0].id < 0) {
selectObject.items[0] = $scope.newItem(selectObject.search);
}
}
}

$scope.newItem = function (tag) {
    return {
        id : -1,
        name : tag
    }
}`

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

5 participants