首页 > 解决方案 > 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):

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!

标签: ionic-frameworkfirefoxresponsive-designionic4user-agent

解决方案


好的。经过更多的测试,我想通了。这在响应式设计模式的触摸模拟中似乎有些奇怪。我不小心禁用了它(真的应该早点尝试),问题就消失了。我不知道是什么导致了这种奇怪的行为,并且仍然会受到解释,但修复很容易。


推荐阅读