Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Safari Select Won't Open

Given a simple select list.

<select>
    <option>Test 1</option>
    <option>Test 2</option>
    <option>Test 3</option>
    <option>Test 4</option>
</select>

Running Example: http://jsfiddle.net/gbdvn2ht/

  1. Open Page in Safari (8.0.8 or earlier I presume, it works as expected in OSX 10.11)
  2. Observe that clicking quickly over and over on the select list opens the select list and selects the first item.
  3. Focus on another window (I used a terminal but it doesn't matter)
  4. While focused on the other window click back into the Safari tab but make sure you click directly on the select and continue clicking quickly.
  5. Observe that the select initial opens, closes, and then stops responding. A page refresh of the page is the only way to make it work again. Clicking on it no longer opens the select list.

Strange right?

Given the fact that the newest Safari doesn't present the problem I can assume it's a Safari bug. However, I still need to support this version of the browser. Any ideas on a workaround would be greatly appreciated.

like image 747
Jab Avatar asked Feb 02 '26 12:02

Jab


1 Answers

I do not have access to that version of Safari, but have you tried using a jquery plugin to override the drop down ? I thought it would be worth a shot.

I've updated the jsfiddle for you to try.

http://jsfiddle.net/gbdvn2ht/1/

The plugin I tried was Select2 (https://select2.github.io/examples.html)

$("#select").select2({
    minimumResultsForSearch: Infinity
});
like image 83
UnitStack Avatar answered Feb 04 '26 05:02

UnitStack



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!