-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
clearOptions: Don't remove already selected items #1080
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Changes Unknown when pulling 72a065d on andrey-lizunov:master into * on selectize:master*. |
Can you explain your PR? I wasn't able to understand the issue ref'd. |
@joallard I found that selectize accumulates options from previous searches. I upload new list of options remotely from my server and the number of selected items not limited. In this case after several searches in dropdown I have a lot of options connected with old queries which I don't need. This PR change this behavior, now the list of selected items stay unchanged, but list of options for select is cleared. |
delete options[key]; | ||
} | ||
}); | ||
self.options = self.sifter.items = options; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this not the same as:
$.each(self.options, function(key, value) {
if(self.items.indexOf(key) == -1) {
delete self.options[key];
}
});
self.sifter.items = self.options;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@brookjordan I confirm, your code works fine.
Any workaround for this? |
Is this still open? |
@colalex This issue is not about deleting a selected item. |
still open ? |
@joallard Any chance you can merge this? A couple of these really small fixes for impactful UX issues are hanging around, and we could really use your help. |
Had to rebase that one |
2021 and this is still an issue... unbelievable... |
Would you believe that a PR closed two years ago might not be quite relevant to today's environment? Feel free to open a new issue with a working example, or submit your own PR with the changes you wish to see. |
Closed #1079