bootstrap-combobox
bootstrap-combobox copied to clipboard
Dropdown doesn't close lost focusing with modal.
I have a combobox with a lot of data, when i focus everything works ok i can search and lost focus and the dropdown close, the problem is when i scroll the dropbox menu this doesn't close losing the focus, i just can close the dropdown choosing an option after scrolling on it. This didn't happen me with with combobox without scroll on the menu.
I know where is the error, everything of this thing is running on a modal windows, then when i press the dropdown menu the textbox who has the focus, is loosed.
I got the solution is just a simply click event on the document but i need to find a way to call hide method directly to the combobox. Currently i'm apply the changes to the CSS
$(document).click(function (event) { console.log(event.target.tagName); switch (event.target.tagName) { case 'UL': break; default : $('.dropdown-menu').css('display', 'none'); } });
I've noticed the dropdown not closing on focus lost at times too, but can't seem to repeat it. I also use it in a dynamic Make and Model selection, and at times when I click an item in the dropdown the change event somehow fires before the value is set, so getting the val gives me an empty string. There just seems to be a weird flow sometimes and I can't get it to show in a way I can repeat.