harvesthq / chosen

Deprecated - Chosen is a library for making long, unwieldy select boxes more friendly.
http://harvesthq.github.io/chosen/
Other
21.85k stars 4.1k forks source link

overlap drop down box if click outside browser window #3119

Open keepcalm15 opened 3 years ago

keepcalm15 commented 3 years ago

Dear developer,

We tried to set up two select that use chosen plugin. A similar page can be seen https://makitweb.com/make-user-friendly-select-element-with-chosen-jquery/

from Initialize section from above link (OS: windows 7. chrome)

  1. click multiple select box first
  2. then click everywhere outside browser window
  3. then click single select drop down box
  4. two drop down box open at the same time

overlapdropdownbox

we have tried the following code close the window when user click outside browser window with no success so far

$(window).blur(function(){ $('select').trigger("chosen:close"); }

$(window).blur(function(){ $(window).blur(); }

I am looking forward to your advise

Thanks, Wang