5

I wish that, when I choose an option, the dropdown menu will close automatically. It doesn't work on Safari (iOS 7).

This is my code:

HTML:

<select id="sel1">
    <option>Option 1</option>
    <option>Option 2</option>
    <option>Option 3</option>
</select>

JS:

$("#sel1").change(function () {
    $(this).blur();
});

On iOS 7, when i trigger the onchange event, the dropdown menù doesn't close automatically, but i have got to tap the "Done" Button (on iOS <=6 it works).

What am I doing wrong?

Thanks in advance

Albegali
  • 71
  • 4
  • Hey! I have the same problem using my_select.vla('my_val').trigger('change').blur() and I also tried focusout and so on but nothing really helped. Could you solve it somehow? – user2718671 Feb 18 '16 at 12:22
  • You can refer in below links: https://stackoverflow.com/questions/10863821/bootstrap-dropdown-closing-when-clicked?rq=1 https://stackoverflow.com/questions/28217706/how-to-close-bootstrap-3-dropdown-when-we-click-outside-on-a-tablet – AmyNguyen Jun 19 '18 at 04:18

0 Answers0