Ionic 4选择在Firefox响应式设计模式下不起作用 [英] Ionic 4 Selects Not Working in Firefox Responsive Design Mode

查看:59
本文介绍了Ionic 4选择在Firefox响应式设计模式下不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近开始使用Ionic框架,并且遇到了关于 ion-select 元素的非常奇怪的错误.一旦被用户点击,它就不会产生离子警报.我本来以为这是我自己的代码中的错误,但是什么也没有发现,并且在意外退出Mozilla Firefox的自适应设计模式时,它可以完美运行.然后,我尝试了此示例代码(来自Ionic文档,了解如何使用 ion-select ).这段代码使用Ionic组件,没有任何框架.在响应式设计模式下,单击选择时它不会生成任何警报,并且不会产生任何错误.我在Ubuntu 18.04上使用Firefox 71.0(64位).

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.

在没有响应式设计模式的情况下,并且在缩小浏览器窗口的同时,selects功能也可以完美地发挥作用.在响应式设计模式下,它们在模拟大型设备(例如电视)时可以正常工作,但不能与其他任何设备一起使用.我以为这可能是用户代理中的错误,因此这是一个用户代理,它在不起作用时(电视和笔记本电脑没有用户代理,它们的大小不同):

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

更新:我做了进一步的测试,解决该问题的另一件事是从其 ion-item 容器中删除了 ion-select .我不知道为什么这可以解决问题,这改变了我最初的想法,那就是与用户代理有关.另外,我尝试将浏览器的用户代理手动更改为上述代理,并且选择效果完美.这似乎是响应式设计模式的问题吗?

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?

任何帮助将不胜感激!

推荐答案

好的.经过更多测试后,我发现了这一点.在响应式设计模式的触摸模拟中,这似乎有些奇怪.我不小心禁用了它(真的应该早点尝试),问题就消失了.我不知道是什么原因导致这种奇怪的行为,仍然可以理解,但解决方法很容易.

Okay. I figured it out after a lot more testing. This appears to be some strange thing in the touch simulation of Responsive Design Mode. I accidentally disabled it (really should've tried that sooner), and the problem was gone. I have no idea what causes this odd behaviour and an explanation would still be appreciated, but the fix is quite easy.

这篇关于Ionic 4选择在Firefox响应式设计模式下不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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