Open indrimuska opened 8 years ago
@indrimuska This has another issue as well. Selected options are removed after fetching in a multi selector.
Same scenario. Same plunker.
Hi guys , Any update on this issue , kinda critical issue if some one points to me to right direction i might able to solve it !
@matt212 Try my fork.
The problem was here:
scope.updateSelected = function () {
if (!scope.multiple) scope.selectedValues = (scope.options || []).filter(function (option) { return scope.optionEquals(option); }).slice(0, 1);
else {
var val;
val = (scope.value || []).map(function (value) {
return filter(scope.options.concat(allOptions), function (option) {
return scope.optionEquals(option, value);
})[0];
}).filter(function (value) { return angular.isDefined(value); }).slice(0, scope.limit);
scope.selectedValues = val;
}
};
Options were being filtered after fetching again. I'm storing the options being fetched in my fork, had no time to implement a better solution att.
Hi @ssotomayor , you are life saver ! thanks for insight and patch !
How can i add values using create feature not from user input but from angularjs file. for eg :- instance of "selector" ,create (json object) and it should added to multiselect Any suggestions ? `
This is fixed in a high performance variant/fork of the same component: https://github.com/jkodu/angular-selector-on-steroids
Refer enhanced example page - https://jkodu.github.io/angular-selector-on-steroids/ (allow unsafe scripts).
@jkodu oh wow, did you fix the remote fetching issue mentioned above? Can't get the options to load up on your example page.
Have you allowed unsafe scripts along the prompt on the address bar?
@ssotomayor see comment above.
Plunker
http://plnkr.co/edit/CGY47bqX0dLnFkrVY3aB?p=preview
Scenario
Steps to reproduce the issue