1
選擇在桌面上正常工作的選項,但在刷新後嘗試在移動頁面上顯示選項時不顯示選項。 有人可以幫助我嗎?angularjs - >素材 - >選擇 - >選項 - >僅在手機上 - >不工作
plunker https://embed.plnkr.co/FMvR2vKh5W8D8Fbbx11R/
選擇在桌面上正常工作的選項,但在刷新後嘗試在移動頁面上顯示選項時不顯示選項。 有人可以幫助我嗎?angularjs - >素材 - >選擇 - >選項 - >僅在手機上 - >不工作
plunker https://embed.plnkr.co/FMvR2vKh5W8D8Fbbx11R/
根據角材質代碼中的註釋,似乎他們劫持移動模式下的所有點擊,以防止一些鬼點擊舊的瀏覽器:
[...]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();
})