Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Chrome for Android <select> element doesn't select any option

I've a select element on my single page web app. The app has responsive design to work on mobile devices. Below is the link for development version.

http://mapcodexpublish.com/mcxwebdev/

Theselect element works well on all browsers but chrome for mobile. On chrome for android, when I thouch it shows the option list, but when select an option, it doesnt change at all. I've tried to alert something on change event but it wasn't fired.

I tired on real devices, but here is screenshots from an emulator. That's exact same.

state 1

state 2

state 3

Is there any one had similar problem or any idea to solve this wierd problem ?

like image 336
Halil Ibrahim Avatar asked May 14 '26 03:05

Halil Ibrahim


1 Answers

The super hacky fix that seemed to work for me was to trigger a blur event on the select when it triggers a change. Something like:

$('select').change(function(){
  if (/Android/.test(navigator.userAgent)){
    $(this).blur();
  }
});

Really not proud of this "fix", but it works.

like image 85
ehsanul Avatar answered May 15 '26 18:05

ehsanul



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!