【发布时间】:2017-11-13 19:40:35
【问题描述】:
选择选项在桌面上运行良好,但是当您在刷新后在移动页面上尝试时,它不会显示选项。 有人可以帮我安排吗?
【问题讨论】:
标签: angularjs select options angularjs-material
选择选项在桌面上运行良好,但是当您在刷新后在移动页面上尝试时,它不会显示选项。 有人可以帮我安排吗?
【问题讨论】:
标签: angularjs select options angularjs-material
根据 Angular Material 代码中的 cmets,它们似乎劫持了移动模式下的所有点击,以防止在旧浏览器上出现一些鬼点击:
[...]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
(在函数attachToDocument 中从angular-material.js 中的cmets 中提取)。
如果您想禁用此行为,您可以在引导过程中configure 它。在myApp变量的定义后面加上这段代码:
myApp.config(function($mdGestureProvider){
$mdGestureProvider.skipClickHijack();
})
【讨论】: