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

onOptionSelect: dropdown options menu disappears and shows up again #37

Open
chrisv-dev opened this issue Feb 10, 2016 · 1 comment
Open

Comments

@chrisv-dev
Copy link

When selecting an option (by clicking or using enter key) for the first time (!) after pageload, the list of all options disappears and shows up again. After selecting the desired option once again, the options disappear and from this moment everything is working fine.

This problem also occurs in the provided demo: http://plnkr.co/edit/4BuWxF

@impworks
Copy link

I came across this issue today in my project and found the reason behind it: when the watches initially fire on page load, both optionsUpdate and modelUpdate flags are set, while usually only one of them should be set at a given time. The scheduleUpdate function should reset both flags if Selectize has not yet been initialized:

function scheduleUpdate() {
    if (!selectize) {
        if (!initializing) {
            initSelectize();
        }

        // ===== Added =====
        modelUpdate = optionsUpdate = false;
        // ===== Added =====

        return;
    }

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

2 participants