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

Removed selected item doesn't appear in search suggestions #1398

Closed
Joozty opened this issue Apr 25, 2018 · 2 comments
Closed

Removed selected item doesn't appear in search suggestions #1398

Joozty opened this issue Apr 25, 2018 · 2 comments

Comments

@Joozty
Copy link

Joozty commented Apr 25, 2018

As the title says I am using selectize.js and I have a problem with options loaded after selectize object was created.

After I select an option from drop-down menu and remove it from an input box. That option doesn't appear in drop-down menu again.

My HTML:

<input type="text" id="input-tags3" class="demo-default selectized" value="" tabindex="-1" style="display: none;">

My JS:

        $('#input-tags5').selectize({
            plugins: ['remove_button'],
            persist: false,
            create: false,
            valueField: 'value',
            labelField: 'text',
            searchField: 'text'
        });

        $('#input-tags5')[0].selectize.addOption({value: 1, text: 'one'});
        $('#input-tags5')[0].selectize.refreshOptions(true);
@Joozty Joozty changed the title Removed selected item doesn't appear in search result Removed selected item doesn't appear in search suggestions Apr 25, 2018
@Joozty
Copy link
Author

Joozty commented Apr 25, 2018

Similar issue as here:
#683 (comment)

@Joozty
Copy link
Author

Joozty commented Apr 25, 2018

Ok, my bad I found where was an error. It is because of this line persist: false, -> needs to be true. Sorry :)

@Joozty Joozty closed this as completed Apr 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant