ionic-framework - Ionic 4 Selects Not Working in Firefox Responsive Design Mode
问题描述
I have recently started working with the Ionic framework, and have encountered a very strange error regarding the ion-select
element. Upon being clicked by the user, it generates no Ionic alert. I originally thought it was an error in my own code, however found nothing, and upon accidentally exiting Mozilla Firefox's Responsive Design Mode, it worked perfectly. I then tried this sample code from the Ionic documentation on how to use ion-select
. This code uses the Ionic components without any framework. In Responsive Design Mode, it fails to generate any alerts when the selects are clicked, and no errors are produced. I'm using Firefox 71.0 (64-bit) on Ubuntu 18.04.
The selects function perfectly without Responsive Design Mode, and while shrinking the browser window. In Responsive Design Mode, they do function properly when simulating large devices, such as a TV, but not with anything else. I thought this might be an error in the user agent, so here is a user agent for when it doesn't work (TVs and Laptops have no user agent, they are just different sizes):
- Galaxy S9/S9+:
Mozilla/5.0 (Linux; Android 7.0; SM-G892A Build/NRD90M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/67.0.3396.87 Mobile Safari/537.36
UPDATE: I did some further testing and the other thing that fixes the problem is removing the ion-select
from its ion-item
container. I have no idea why this would fix the problem, which changes my original idea that this could be to do with the user agent. Also, I tried manually changing my browser's user agent to the above, and the selects work perfectly. This appears to be an issue with Responsive Design Mode?
Any help would be appreciated!
解决方案
好的。经过更多的测试,我想通了。这在响应式设计模式的触摸模拟中似乎有些奇怪。我不小心禁用了它(真的应该早点尝试),问题就消失了。我不知道是什么导致了这种奇怪的行为,并且仍然会受到解释,但修复很容易。
推荐阅读
- .net-core - 区分大小写的 url,必须与 SP 元数据中指定的完全相同
- excel - 使用excel将不规则间隔的值转换为分钟值
- google-chrome - 为什么我的代码可以在 Firefox (Greasemonkey) 中运行,但不能在 Chrome (Tampermonkey) 中运行?
- udp - UDP STM32-错误:无法访问目标主机
- php - 如何在 Symfony 5 中编码密码?
- c++ - C++ 函数指针参数和类继承自动转换
- cordova - ionic 4 中的 Gallery 中未显示下载的视频
- powershell - 单击Powershell中的按钮后从Listbox-Item获取ID
- java - 使用 ModelMapper 映射抽象类型的字段
- python - 我正在尝试使用 Python 获取邮件的接收时间,但每次都会出现以下错误