Open yogevge opened 6 years ago
<ui-select ng-model="request.selectedFoo" theme="bootstrap" tagging-label="" tagging="addFoo"> <ui-select-match placeholder="--- Select Foo---">{{$select.selected.name}}</ui-select-match> <ui-select-choices repeat="foo in foos | filter: $select.search"> <div ng-bind-html="foo.name | highlight: $select.search"></div> </ui-select-choices> </ui-select>
I have a problem where I can't accept tagging with "On blur" I saw some improvements for multiple but nothing for one choice.
I saw this directive: app.directive('tagOnBlur', function ($timeout) { return { require: 'uiSelect', link: function (scope, elm, attrs, ctrl) { ctrl.searchInput.on('blur', function () { if ((ctrl.items.length > 0 || ctrl.tagging.isActivated)) { $timeout(function () { ctrl.searchInput.triggerHandler('tagged'); var newItem = ctrl.search; if (ctrl.tagging.fct) { newItem = ctrl.tagging.fct(newItem); } if (newItem) ctrl.select(newItem, true); }); } }); } }; })
app.directive('tagOnBlur', function ($timeout) { return { require: 'uiSelect', link: function (scope, elm, attrs, ctrl) { ctrl.searchInput.on('blur', function () { if ((ctrl.items.length > 0 || ctrl.tagging.isActivated)) { $timeout(function () { ctrl.searchInput.triggerHandler('tagged'); var newItem = ctrl.search; if (ctrl.tagging.fct) { newItem = ctrl.tagging.fct(newItem); } if (newItem) ctrl.select(newItem, true); }); } }); } }; })
But it doesn't accept when I click on something from the list (regular option) is there an option to accept a tag with "on blur"?
Duplicate #2133
I have a problem where I can't accept tagging with "On blur" I saw some improvements for multiple but nothing for one choice.
I saw this directive:
app.directive('tagOnBlur', function ($timeout) { return { require: 'uiSelect', link: function (scope, elm, attrs, ctrl) { ctrl.searchInput.on('blur', function () { if ((ctrl.items.length > 0 || ctrl.tagging.isActivated)) { $timeout(function () { ctrl.searchInput.triggerHandler('tagged'); var newItem = ctrl.search; if (ctrl.tagging.fct) { newItem = ctrl.tagging.fct(newItem); } if (newItem) ctrl.select(newItem, true); }); } }); } }; })
But it doesn't accept when I click on something from the list (regular option) is there an option to accept a tag with "on blur"?