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

repeated click will not show list #3115

Open
applibs opened this issue Mar 9, 2021 · 3 comments
Open

repeated click will not show list #3115

applibs opened this issue Mar 9, 2021 · 3 comments

Comments

@applibs
Copy link

applibs commented Mar 9, 2021

When I click on chosen initialized element it will show me my list and I will select one item - OK
My selected item is visible in box - OK

I want to select another one from list, but after click list will not show. I must click outside ot that element and then click inside again and then it will show my list options. Its bad.

@applibs applibs changed the title results_showing is still true after results_hide() called repeated click will not show list Mar 9, 2021
@blackdrago
Copy link

There's a setting for that:

$('#someFieldName').chosen({ hide_results_on_select: false });

@applibs
Copy link
Author

applibs commented Mar 18, 2021

You described different functionality.

Problem is that when I select anything from list it will make focus to ".search-field.chosen-search-input". For me is expected when its lost focus (blur) and I will click / initiate focus by click -> It will show me rest items from list I select another item.

New setting like "leaveAfterSelected" which will do it, will be nice.

@applibs
Copy link
Author

applibs commented Nov 6, 2023

I found solution:
My function "search_results_mouseup" looks like this working solution:

Chosen.prototype.search_results_mouseup = function (evt) {
            var target;
            target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
            if (target.length) {
                this.result_highlight = target;
                this.result_select(evt);
                if(this.is_multiple) {
                    return this.close_field();
                }
                return this.search_field.focus();
            }
        };

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