角度的UI工具提示在ng-repeat中不关闭

时间:2021-07-26 19:41:09

Please see the plunker below: http://plnkr.co/edit/RPpjULZsSDnTFPKiafl2

请见下面的柱塞:http://plnkr.co/edit/RPpjULZsSDnTFPKiafl2。

Basically, the angular-ui tooltip remains when moving up / down to a position where ng-disabled is true. Any thoughts on how to fix the issue would be much appreciated!

基本上,当向上/向下移动到禁用ng的位置时,angular-ui工具提示仍然保留。任何关于如何解决这个问题的想法都将非常感谢!

I'm using Chrome, but the issue appears more serious in Firefox where even with ng-disabled removed the tooltips still remain on mouseleave.

我使用的是Chrome浏览器,但在火狐浏览器中,这个问题显得更加严重,即使禁用了ng,工具提示仍然保留在mouseleave上。

2 个解决方案

#1


3  

You can use the $tooltipProvider and alter the trigger map to take click as an additional hide trigger for the mouseenter show trigger:

您可以使用$tooltipProvider并修改触发器映射,将click作为鼠标输入显示触发器的附加隐藏触发器:

myApp.config(['$tooltipProvider', function($tooltipProvider){
  $tooltipProvider.setTriggers({
    'mouseenter': 'mouseleave click'
  });
}]);

v0.9.0 of AngularUI suffered from this issue which caused errors (although still worked) on delete buttons (for instance) which had a tooltip. This has been subsequently fixed in v0.10.0.

AngularUI的v0.9.0受到此问题的影响,导致具有工具提示的delete按钮(例如)出现错误(尽管仍然有效)。这在v0.10.0中被修正。

Here's a demo of it in action

这是一个实际的演示

#2


0  

I assume ng-disabled also disables any events from triggering on the buttons. Then, when you move a row down to the last row (or up to the first), the event handlers are disabled before the mouseout event is handled. It works if you trigger the mouseout event "manually" when the click event is handled.

我假设禁用了ng也会禁用任何触发按钮的事件。然后,当您将一行向下移动到最后一行(或向上移动到第一行)时,在处理mouseout事件之前禁用事件处理程序。当单击事件被处理时,如果您“手动”触发mouseout事件,那么它将工作。

plunker

砰砰作响

This may actually be a bug worth pointing out to the angular team.

这实际上可能是一个值得角队指出的错误。

#1


3  

You can use the $tooltipProvider and alter the trigger map to take click as an additional hide trigger for the mouseenter show trigger:

您可以使用$tooltipProvider并修改触发器映射,将click作为鼠标输入显示触发器的附加隐藏触发器:

myApp.config(['$tooltipProvider', function($tooltipProvider){
  $tooltipProvider.setTriggers({
    'mouseenter': 'mouseleave click'
  });
}]);

v0.9.0 of AngularUI suffered from this issue which caused errors (although still worked) on delete buttons (for instance) which had a tooltip. This has been subsequently fixed in v0.10.0.

AngularUI的v0.9.0受到此问题的影响,导致具有工具提示的delete按钮(例如)出现错误(尽管仍然有效)。这在v0.10.0中被修正。

Here's a demo of it in action

这是一个实际的演示

#2


0  

I assume ng-disabled also disables any events from triggering on the buttons. Then, when you move a row down to the last row (or up to the first), the event handlers are disabled before the mouseout event is handled. It works if you trigger the mouseout event "manually" when the click event is handled.

我假设禁用了ng也会禁用任何触发按钮的事件。然后,当您将一行向下移动到最后一行(或向上移动到第一行)时,在处理mouseout事件之前禁用事件处理程序。当单击事件被处理时,如果您“手动”触发mouseout事件,那么它将工作。

plunker

砰砰作响

This may actually be a bug worth pointing out to the angular team.

这实际上可能是一个值得角队指出的错误。