选择在桌面上工作正常的选项,但是当您在刷新后在移动页面上尝试它时,它不会显示选项。 有人可以帮助我吗?
答案 0 :(得分:1)
根据Angular Material代码中的评论,他们似乎劫持了移动模式下的所有点击,以防止旧版浏览器上的一些鬼点击:
[...]we preventDefault any click that wasn't sent by ngMaterial. This is
because on older Android & iOS, a false, or 'ghost', click event will be
sent ~400ms after a touchend event happens. The only way to know if this
click is real is to prevent any normal click events, and add a flag to
events sent by material so we know not to prevent those.
Two exceptions to click events that should be prevented are:
- click events sent by the keyboard (eg form submit)
- events that originate from an Ionic app
(摘自函数angular-material.js
中attachToDocument
中的评论)。
如果要禁用此行为,可以在引导期间configure
。在myApp
变量的定义之后添加此代码:
myApp.config(function($mdGestureProvider){
$mdGestureProvider.skipClickHijack();
})