离子触发不需要的ng单击右键单击和中间点击

问题描述:

我在最新的Chrome版本和铬金丝雀中使用Ionic在某些非常奇怪的原因右击导致ng-click触发。离子触发不需要的ng单击右键单击和中间点击

Code Pen demonstrating the issue

任何一个可以提供一些线索?

+0

我从来没有见过这样的...... –

+2

这真的很奇怪,当你在IE控制台中查看事件时,有两个事件,一个是“PointerEvent”,你可以在其中检测鼠标的哪个按钮被点击。在Chome中,只有一个'MouseEvent',其中'which'属性总是='1'(左键单击) – Alexis

+1

Ionic是创建移动应用程序的框架。当您在手机上使用应用程序时,没有左键或右键点击,只有轻按。因此,左右点击相同可能是设计决定。 – FrancisA

这个更改按钮标签,

<button type="button" class="button button-large button-energized" ng-click="test()">click me!!!</button> 

或者

<button type="button" class="button button-large button-energized" ng-click="test($event)">click me!!!</button>

和控制器上:

$scope.test = function($event){$event.preventDefault();alert(1); 

希望这有助于。