title: Html select dropdown is hiding, after dragging scrollbar using mouse in windows 10 cordova application
body: <p>I am preparing cordova mobile application targeting windows 10.</p>
  
  <p><strong>Issue Description :</strong> For huge(>30) options in HTML select, if I drag scrollbar to select the bottom options, select menu dropdown is closing after releasing the mouse left button(app is treating it as I clicked on outside of select). 
  I prepared simple html windows 10 cordova application without jquery mobile, where it is working fine for windows10. But if I add jquery mobile, it is not working as expected. Select is working fine in Browsers, Android, ios, issue is only in windows10 cordova application.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"&gt;&lt;/script&gt;
  &lt;html&gt;
  &lt;head&gt;
       &lt;link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" /&gt;
    &lt;link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile.theme-1.4.5.min.css" type="text/css" media="screen" title="no title" charset="utf-8" /&gt;
    &lt;link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile.structure-1.4.5.min.css" type="text/css" media="screen" title="no title" charset="utf-8" /&gt;
    &lt;script type="text/JavaScript" src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"&gt;&lt;/script&gt;
     
  &lt;/head&gt;
  &lt;body&gt;
      &lt;br&gt;
      &lt;select &gt;
          &lt;option value=""&gt;Select (Huge)&lt;/option&gt;
          &lt;option value="LS"&gt;TRANSFORMER VAULT - STAIRS&lt;/option&gt;
          &lt;option value="M4"&gt;UTILITY ROOM - 4TH&lt;/option&gt;
          &lt;option value="M5"&gt;UTILITY ROOM - 5TH&lt;/option&gt;
          &lt;option value="M2"&gt;UTILITY ROOM - 2ND&lt;/option&gt;
          &lt;option value="LR"&gt;TRANSFORMER VAULT - RIGHT&lt;/option&gt;
          &lt;option value="M3"&gt;UTILITY ROOM - 3RD&lt;/option&gt;
          &lt;option value="LB"&gt;TRANSFORMER VAULT - BACK&lt;/option&gt;
          &lt;option value="LF"&gt;TRANSFORMER VAULT - FRONT&lt;/option&gt;
          &lt;option value="LL"&gt;TRANSFORMER VAULT - LEFT&lt;/option&gt;
          &lt;option value="LI"&gt;TRANSFORMER VAULT - BARN&lt;/option&gt;
          &lt;option value="LO"&gt;TRANSFORMER VAULT - OUTSIDE&lt;/option&gt;
          &lt;option value="LP"&gt;TRANSFORMER VAULT - POLE&lt;/option&gt;
          &lt;option value="M1"&gt;UTILITY ROOM - 1ST&lt;/option&gt;
          &lt;option value="LN"&gt;TRANSFORMER VAULT - NORTH&lt;/option&gt;
          &lt;option value="MT"&gt;UTILITY ROOM - REAR&lt;/option&gt;
          &lt;option value="MR"&gt;UTILITY ROOM - RIGHT&lt;/option&gt;
          &lt;option value="N3"&gt;CLOSET - 3RD&lt;/option&gt;
          &lt;option value="MS"&gt;UTILITY ROOM - STAIRS&lt;/option&gt;
          &lt;option value="MW"&gt;UTILITY ROOM - WEST&lt;/option&gt;
          &lt;option value="MZ"&gt;UTILITY ROOM - UNKNOWN&lt;/option&gt;
          &lt;option value="NB"&gt;CLOSET - BACK&lt;/option&gt;
          &lt;option value="ME"&gt;UTILITY ROOM - EAST&lt;/option&gt;
          &lt;option value="MB"&gt;UTILITY ROOM - BACK&lt;/option&gt;
          &lt;option value="MI"&gt;UTILITY ROOM - BARN&lt;/option&gt;
          &lt;option value="MF"&gt;UTILITY ROOM - FRONT&lt;/option&gt;
          &lt;option value="ML"&gt;UTILITY ROOM - LEFT&lt;/option&gt;
          &lt;option value="MP"&gt;UTILITY ROOM - POLE&lt;/option&gt;
          &lt;option value="N1"&gt;CLOSET - 1ST&lt;/option&gt;
          &lt;option value="MQ"&gt;UTILITY ROOM - SOUTH&lt;/option&gt;
          &lt;option value="N2"&gt;CLOSET - 2ND&lt;/option&gt;
          &lt;option value="MN"&gt;UTILITY ROOM - NORTH&lt;/option&gt;
          &lt;option value="MO"&gt;UTILITY ROOM - OUTSIDE&lt;/option&gt;
          &lt;option value="NS"&gt;CLOSET - STAIRS&lt;/option&gt;
          &lt;option value="O4"&gt;OUTSIDE - 4TH&lt;/option&gt;
          &lt;option value="NT"&gt;CLOSET - REAR&lt;/option&gt;
          &lt;option value="NZ"&gt;CLOSET - UNKNOWN&lt;/option&gt;
          &lt;option value="OB"&gt;OUTSIDE - BACK&lt;/option&gt;
          &lt;option value="NE"&gt;CLOSET - EAST&lt;/option&gt;
          &lt;option value="NF"&gt;CLOSET - FRONT&lt;/option&gt;
          &lt;option value="NL"&gt;CLOSET - LEFT&lt;/option&gt;
          &lt;option value="NR"&gt;CLOSET - RIGHT&lt;/option&gt;
          &lt;option value="NP"&gt;CLOSET - POLE&lt;/option&gt;
          &lt;option value="O1"&gt;OUTSIDE - 1ST&lt;/option&gt;
          &lt;option value="OW"&gt;OUTSIDE - WEST&lt;/option&gt;
          &lt;option value="OT"&gt;OUTSIDE - REAR&lt;/option&gt;
          &lt;option value="OZ"&gt;OUTSIDE - UNKNOWN&lt;/option&gt;
          &lt;option value="PB"&gt;PORCH - BACK&lt;/option&gt;
          &lt;option value="OF"&gt;OUTSIDE - FRONT&lt;/option&gt;
          &lt;option value="OE"&gt;OUTSIDE - EAST&lt;/option&gt;
          &lt;option value="OI"&gt;OUTSIDE - BARN&lt;/option&gt;
          &lt;option value="ON"&gt;OUTSIDE - NORTH&lt;/option&gt;
          &lt;option value="OO"&gt;OUTSIDE - OUTSIDE&lt;/option&gt;
          &lt;option value="OL"&gt;OUTSIDE - LEFT&lt;/option&gt;
          &lt;option value="OR"&gt;OUTSIDE - RIGHT&lt;/option&gt;
          &lt;option value="OS"&gt;OUTSIDE - STAIRS&lt;/option&gt;
          &lt;option value="OP"&gt;OUTSIDE - POLE&lt;/option&gt;
          &lt;option value="P1"&gt;PORCH - 1ST&lt;/option&gt;
          &lt;option value="OQ"&gt;OUTSIDE - SOUTH&lt;/option&gt;
          &lt;option value="PZ"&gt;PORCH - UNKNOWN&lt;/option&gt;
          &lt;option value="A1"&gt;ATTIC - 1ST&lt;/option&gt;
          &lt;option value="A4"&gt;ATTIC - 4TH&lt;/option&gt;
          &lt;option value="A3"&gt;ATTIC - 3RD&lt;/option&gt;
          &lt;option value="STR"&gt;Near Street&lt;/option&gt;
          &lt;option value="PF"&gt;PORCH - FRONT&lt;/option&gt;
          &lt;option value="PL"&gt;PORCH - LEFT&lt;/option&gt;
          &lt;option value="PO"&gt;PORCH - OUTSIDE&lt;/option&gt;
          &lt;option value="PP"&gt;PORCH - POLE&lt;/option&gt;
          &lt;option value="PS"&gt;PORCH - STAIRS&lt;/option&gt;
          &lt;option value="PT"&gt;PORCH - REAR&lt;/option&gt;
          &lt;option value="PR"&gt;PORCH - RIGHT&lt;/option&gt;
          &lt;option value="AF"&gt;ATTIC - FRONT&lt;/option&gt;
          &lt;option value="AL"&gt;ATTIC - LEFT&lt;/option&gt;
          &lt;option value="LEFT"&gt;Left side of house&lt;/option&gt;
          &lt;option value="AP"&gt;ATTIC - POLE&lt;/option&gt;
          &lt;option value="B1"&gt;BATHROOM - 1ST&lt;/option&gt;
          &lt;option value="B2"&gt;BATHROOM - 2ND&lt;/option&gt;
          &lt;option value="RF"&gt;UNDER HOUSE - FRONT&lt;/option&gt;
          &lt;option value="1"&gt;1&lt;/option&gt;
          &lt;option value="B3"&gt;BATHROOM - 3RD&lt;/option&gt;
          &lt;option value="2"&gt;2&lt;/option&gt;
          &lt;option value="QL"&gt;UNDER COUNTER - LEFT&lt;/option&gt;
          &lt;option value="10"&gt;10&lt;/option&gt;
          &lt;option value="AB"&gt;ATTIC - BACK&lt;/option&gt;
          &lt;option value="QR"&gt;UNDER COUNTER - RIGHT&lt;/option&gt;
          &lt;option value="BI"&gt;BATHROOM - BARN&lt;/option&gt;
          &lt;option value="RZ"&gt;UNDER HOUSE - UNKNOWN&lt;/option&gt;
          &lt;option value="RW"&gt;UNDER HOUSE - WEST&lt;/option&gt;
          &lt;option value="BL"&gt;BATHROOM - LEFT&lt;/option&gt;
          &lt;option value="C2"&gt;CELLAR - 2ND&lt;/option&gt;
          &lt;option value="SB"&gt;STAIRS - BACK&lt;/option&gt;
          &lt;option value="BR"&gt;BATHROOM - RIGHT&lt;/option&gt;
          &lt;option value="C3"&gt;CELLAR - 3RD&lt;/option&gt;
          &lt;option value="BP"&gt;BATHROOM - POLE&lt;/option&gt;
          &lt;option value="C1"&gt;CELLAR - 1ST&lt;/option&gt;
          &lt;option value="SF"&gt;STAIRS - FRONT&lt;/option&gt;
          &lt;option value="C4"&gt;CELLAR - 4TH&lt;/option&gt;
          &lt;option value="BT"&gt;BATHROOM - REAR&lt;/option&gt;
          &lt;option value="C5"&gt;CELLAR - 5TH&lt;/option&gt;
          &lt;option value="RL"&gt;UNDER HOUSE - LEFT&lt;/option&gt;
          &lt;option value="BB"&gt;BATHROOM - BACK&lt;/option&gt;
          &lt;option value="RR"&gt;UNDER HOUSE - RIGHT&lt;/option&gt;
          &lt;option value="S1"&gt;STAIRS - 1ST&lt;/option&gt;
          &lt;option value="BE"&gt;BATHROOM - EAST&lt;/option&gt;
          &lt;option value="RS"&gt;UNDER HOUSE - STAIRS&lt;/option&gt;
          &lt;option value="CI"&gt;CELLAR - BARN&lt;/option&gt;
          &lt;option value="CN"&gt;CELLAR - NORTH&lt;/option&gt;
          &lt;option value="CO"&gt;CELLAR - OUTSIDE&lt;/option&gt;
          &lt;option value="CL"&gt;CELLAR - LEFT&lt;/option&gt;
          &lt;option value="CR"&gt;CELLAR - RIGHT&lt;/option&gt;
          &lt;option value="CS"&gt;CELLAR - STAIRS&lt;/option&gt;
          &lt;option value="CP"&gt;CUSTOMER POLE&lt;/option&gt;
          &lt;option value="D1"&gt;PUMPHOUSE - 1ST&lt;/option&gt;
          &lt;option value="CQ"&gt;CELLAR - SOUTH&lt;/option&gt;
          &lt;option value="TB"&gt;OFFICE - BACK&lt;/option&gt;
          &lt;option value="CW"&gt;CELLAR - WEST&lt;/option&gt;
          &lt;option value="CT"&gt;CELLAR - REAR&lt;/option&gt;
          &lt;option value="D5"&gt;PUMPHOUSE - 5TH&lt;/option&gt;
          &lt;option value="TF"&gt;OFFICE - FRONT&lt;/option&gt;
          &lt;option value="BZ"&gt;BATHROOM - UNKNOWN&lt;/option&gt;
          &lt;option value="SN"&gt;STAIRS - NORTH&lt;/option&gt;
          &lt;option value="SO"&gt;STAIRS - OUTSIDE&lt;/option&gt;
          &lt;option value="CB"&gt;CELLAR - BACK&lt;/option&gt;
          &lt;option value="SR"&gt;STAIRS - REAR&lt;/option&gt;
          &lt;option value="SS"&gt;STAIRS - STAIRS&lt;/option&gt;
          &lt;option value="SP"&gt;STAIRS - POLE&lt;/option&gt;
          &lt;option value="T1"&gt;OFFICE - 1ST&lt;/option&gt;
          &lt;option value="T2"&gt;OFFICE - 2ND&lt;/option&gt;
          &lt;option value="CF"&gt;CELLAR - FRONT&lt;/option&gt;
          &lt;option value="T5"&gt;OFFICE - 5TH&lt;/option&gt;
          &lt;option value="CE"&gt;CELLAR - EAST&lt;/option&gt;
          &lt;option value="DL"&gt;PUMPHOUSE - LEFT&lt;/option&gt;
          &lt;option value="DO"&gt;PUMPHOUSE - OUTSIDE&lt;/option&gt;
          &lt;option value="DP"&gt;PUMPHOUSE - POLE&lt;/option&gt;
          &lt;option value="E1"&gt;SWIMMING POLE - 1ST&lt;/option&gt;
          &lt;option value="DN"&gt;PUMPHOUSE - NORTH&lt;/option&gt;
          &lt;option value="DT"&gt;PUMPHOUSE - REAR&lt;/option&gt;
          &lt;option value="DR"&gt;PUMPHOUSE - RIGHT&lt;/option&gt;
          &lt;option value="DW"&gt;PUMPHOUSE - WEST&lt;/option&gt;
          &lt;option value="CZ"&gt;CELLAR - UNKNOWN&lt;/option&gt;
          &lt;option value="TL"&gt;OFFICE - LEFT&lt;/option&gt;
          &lt;option value="TO"&gt;OFFICE - OUTSIDE&lt;/option&gt;
          &lt;option value="TP"&gt;OFFICE - POLE&lt;/option&gt;
          &lt;option value="TT"&gt;OFFICE - REAR&lt;/option&gt;
          &lt;option value="DB"&gt;PUMPHOUSE - BACK&lt;/option&gt;
          &lt;option value="TR"&gt;OFFICE - RIGHT&lt;/option&gt;
          &lt;option value="DF"&gt;PUMPHOUSE - FRONT&lt;/option&gt;
          &lt;option value="EP"&gt;SWIMMING POLE - POLE&lt;/option&gt;
          &lt;option value="EO"&gt;SWIMMING POLE - OUTSIDE&lt;/option&gt;
          &lt;option value="GARG"&gt;In garage&lt;/option&gt;
          &lt;option value="UP"&gt;BEDROOM - POLE&lt;/option&gt;
          &lt;option value="UR"&gt;BEDROOM - RIGHT&lt;/option&gt;
          &lt;option value="FN"&gt;FIELD - NORTH&lt;/option&gt;
          &lt;option value="FL"&gt;FIELD - LEFT&lt;/option&gt;
          &lt;option value="FQ"&gt;FIELD - SOUTH&lt;/option&gt;
          &lt;option value="FR"&gt;FIELD - RIGHT&lt;/option&gt;
          &lt;option value="FO"&gt;FIELD - OUTSIDE&lt;/option&gt;
          &lt;option value="FP"&gt;FIELD - POLE&lt;/option&gt;
          &lt;option value="G1"&gt;GARAGE - 1ST&lt;/option&gt;
          &lt;option value="FS"&gt;FIELD - STAIRS&lt;/option&gt;
          &lt;option value="FT"&gt;FIELD - REAR&lt;/option&gt;
          &lt;option value="FZ"&gt;FIELD - UNKNOWN&lt;/option&gt;
          &lt;option value="FW"&gt;FIELD - WEST&lt;/option&gt;
          &lt;option value="FB"&gt;FIELD - BACK&lt;/option&gt;
          &lt;option value="FE"&gt;FIELD - EAST&lt;/option&gt;
          &lt;option value="FF"&gt;FIELD - FRONT&lt;/option&gt;
          &lt;option value="FI"&gt;FIELD - BARN&lt;/option&gt;
          &lt;option value="GN"&gt;GARAGE - NORTH&lt;/option&gt;
          &lt;option value="GO"&gt;GARAGE - OUTSIDE&lt;/option&gt;
          &lt;option value="GL"&gt;GARAGE - LEFT&lt;/option&gt;
          &lt;option value="GR"&gt;GARAGE - RIGHT&lt;/option&gt;
          &lt;option value="H3"&gt;HALL - 3RD&lt;/option&gt;
          &lt;option value="H4"&gt;HALL - 4TH&lt;/option&gt;
          &lt;option value="GP"&gt;GARAGE - POLE&lt;/option&gt;
          &lt;option value="H1"&gt;HALL - 1ST&lt;/option&gt;
          &lt;option value="H2"&gt;HALL - 2ND&lt;/option&gt;
          &lt;option value="GT"&gt;GARAGE - REAR&lt;/option&gt;
          &lt;option value="H5"&gt;HALL - 5TH&lt;/option&gt;
          &lt;option value="GZ"&gt;GARAGE - UNKNOWN&lt;/option&gt;
         
         
      &lt;/select&gt;
         
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Without Jquery mobile, I resolved the issue by changing styles at runtime. But I need Jquery mobile as well for my project.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"&gt;&lt;/script&gt;
  &lt;html&gt;
  &lt;head&gt;        
      &lt;script&gt;
            // Should only call edgeSelectHelper if we are in Winodws 10 (not Android or iOS)
            $(document).ready(edgeSelectHelper);
  
            function edgeSelectHelper() { 
      
                  // When any long select gets focus, convert it to a list
                  $("select").focus( function(maxOptions) {
                                      if ($(this).find("option").length &lt;= 30) return;
                                      var pos = $(this).offset();
                                      var width = $(this).css("width");
                                      $(this).css("position", "absolute");
                                      $(this).css("zIndex", 9999);
                                      $(this).offset(pos);
                                      $(this).css("width", width);
                                      $(this).attr("size", 30);
                                  });
  
                  // When any long select loses focus, convert it back to a select
                  $("select").blur( function() {
                                      if ($(this).find("option").length &lt;= 30) return;
                                      $(this).css("position", "static");
                                      $(this).attr("size", 1);
                                  });
  
                  // When any option in a long select is clicked, call blur on the select
                  $("option").click(function(){
                                      if ($(this).parent().find("option").length &lt;= 30) return;
                                      $(this).parent().blur();
                                  });            
            }
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;br&gt;
      &lt;select &gt;
          &lt;option value=""&gt;Select (Huge)&lt;/option&gt;
          &lt;option value="LS"&gt;TRANSFORMER VAULT - STAIRS&lt;/option&gt;
          &lt;option value="M4"&gt;UTILITY ROOM - 4TH&lt;/option&gt;
          &lt;option value="M5"&gt;UTILITY ROOM - 5TH&lt;/option&gt;
          &lt;option value="M2"&gt;UTILITY ROOM - 2ND&lt;/option&gt;
          &lt;option value="LR"&gt;TRANSFORMER VAULT - RIGHT&lt;/option&gt;
          &lt;option value="M3"&gt;UTILITY ROOM - 3RD&lt;/option&gt;
          &lt;option value="LB"&gt;TRANSFORMER VAULT - BACK&lt;/option&gt;
          &lt;option value="LF"&gt;TRANSFORMER VAULT - FRONT&lt;/option&gt;
          &lt;option value="LL"&gt;TRANSFORMER VAULT - LEFT&lt;/option&gt;
          &lt;option value="LI"&gt;TRANSFORMER VAULT - BARN&lt;/option&gt;
          &lt;option value="LO"&gt;TRANSFORMER VAULT - OUTSIDE&lt;/option&gt;
          &lt;option value="LP"&gt;TRANSFORMER VAULT - POLE&lt;/option&gt;
          &lt;option value="M1"&gt;UTILITY ROOM - 1ST&lt;/option&gt;
          &lt;option value="LN"&gt;TRANSFORMER VAULT - NORTH&lt;/option&gt;
          &lt;option value="MT"&gt;UTILITY ROOM - REAR&lt;/option&gt;
          &lt;option value="MR"&gt;UTILITY ROOM - RIGHT&lt;/option&gt;
          &lt;option value="N3"&gt;CLOSET - 3RD&lt;/option&gt;
          &lt;option value="MS"&gt;UTILITY ROOM - STAIRS&lt;/option&gt;
          &lt;option value="MW"&gt;UTILITY ROOM - WEST&lt;/option&gt;
          &lt;option value="MZ"&gt;UTILITY ROOM - UNKNOWN&lt;/option&gt;
          &lt;option value="NB"&gt;CLOSET - BACK&lt;/option&gt;
          &lt;option value="ME"&gt;UTILITY ROOM - EAST&lt;/option&gt;
          &lt;option value="MB"&gt;UTILITY ROOM - BACK&lt;/option&gt;
          &lt;option value="MI"&gt;UTILITY ROOM - BARN&lt;/option&gt;
          &lt;option value="MF"&gt;UTILITY ROOM - FRONT&lt;/option&gt;
          &lt;option value="ML"&gt;UTILITY ROOM - LEFT&lt;/option&gt;
          &lt;option value="MP"&gt;UTILITY ROOM - POLE&lt;/option&gt;
          &lt;option value="N1"&gt;CLOSET - 1ST&lt;/option&gt;
          &lt;option value="MQ"&gt;UTILITY ROOM - SOUTH&lt;/option&gt;
          &lt;option value="N2"&gt;CLOSET - 2ND&lt;/option&gt;
          &lt;option value="MN"&gt;UTILITY ROOM - NORTH&lt;/option&gt;
          &lt;option value="MO"&gt;UTILITY ROOM - OUTSIDE&lt;/option&gt;
          &lt;option value="NS"&gt;CLOSET - STAIRS&lt;/option&gt;
          &lt;option value="O4"&gt;OUTSIDE - 4TH&lt;/option&gt;
          &lt;option value="NT"&gt;CLOSET - REAR&lt;/option&gt;
      &lt;/select&gt;   
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>