Skip to content
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

remove_button for single-option selectize #665

Closed
TachikomaGT opened this issue Jan 12, 2015 · 2 comments
Closed

remove_button for single-option selectize #665

TachikomaGT opened this issue Jan 12, 2015 · 2 comments

Comments

@TachikomaGT
Copy link

Hello!
I want to have single-option selectize with ability to clear selected element. It seems remove_button plugin must be fine for it, but in the start of plugin there are next line:

if (this.settings.mode === 'single') return;

If I comment this line, plugin still not working with maxItems 1, only settings mode multi are supported, so I added

plugins: ['remove_button'],
maxItems: 1,
mode: 'multi'

lines in selectize initialization settings and now everything works well.

Which troubles I can get with this code, should mode option be undocumented in usage.md and is this is are the best way to make remove_button plugin work together with maxItems 1?

@brianreavis
Copy link
Member

Yeah, I think this is mostly a styling task which hasn't been done yet. I'm open to pull requests on this.

@zoltan-sule
Copy link

zoltan-sule commented Jan 4, 2024

@brianreavis
There is still no remove button for single select fields. I am maybe wrong, but the changes above are not in the current master branch (v0.15.2).
https://github.com/selectize/selectize.js/blob/master/src/plugins/remove_button/plugin.js

Could you reopen this, please?

Here are the changes made by @Pictor13 that worked for me
https://github.com/selectize/selectize.js/pull/1311/commits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants