适用于Android的Google Chrome浏览器< select>元素未选择任何选项 [英] Google Chrome for Android <select> element doesn't select any option

查看:171
本文介绍了适用于Android的Google Chrome浏览器< select>元素未选择任何选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在单页Web应用程序中有一个select元素.该应用程序具有响应式设计,可在移动设备上工作.下面是开发版本的链接.

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/

selectselect元素适用于所有浏览器,但适用于移动设备的chrome.在Android版Chrome,当我thouch它显示的选项列表中,但选择一个选项时,它不根本改变.我已尝试在更改事件中提醒某些东西,但没有被解雇.

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.

有没有人有类似的问题或解决这一棘手问题的主意?

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

推荐答案

对我来说似乎有用的超级hacky修复程序是在触发更改时在选择项上触发模糊事件.像这样:

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.

这篇关于适用于Android的Google Chrome浏览器< select>元素未选择任何选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆