2017-06-12 77 views

回答

1

根據角材質代碼中的註釋,似乎他們劫持移動模式下的所有點擊,以防止一些鬼點擊舊的瀏覽器:

[...]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中的評論)。

如果你想禁用這種行爲,你可以在引導過程中使用configure。在myApp變量的定義之後添加此代碼:

myApp.config(function($mdGestureProvider){ 
    $mdGestureProvider.skipClickHijack(); 
})