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

When selectize-input is focused and i click on it - the Dropdown close and open every click. #183

Open
russeljo opened this issue Mar 3, 2021 · 1 comment

Comments

@russeljo
Copy link

russeljo commented Mar 3, 2021

it's work only if:
maxItems: 1,
And it cause some problem
But when maxItems > 1, then dropdown is never close when i click on focused selectize-input.


the problem is that value beacame = ''
I use this selectize/selectize.js#340 (comment) to solve situation when user type wrong text for autocomplete, and then click out of the input - the value is restore to previos.

@russeljo
Copy link
Author

russeljo commented Mar 3, 2021

I think, i found, but maybe i broke smth else, and maybe it's bad practice. In source code:

                        if (e.target !== self.$control_input[0]){
                            //return "single" === self.settings.mode ? self.isOpen ? self.close() : self.open() : defaultPrevented || self.setActiveItem(null),!1
                            return "single" === self.settings.mode ? defaultPrevented : defaultPrevented,!1
                        }

Maybe someone know how better solution?

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