Angular-strap data-trigger='focus' 不工作

Angular-strap data-trigger='focus' not working

data-trigger 焦点对我不起作用...

<span data-content='foo' data-html='true' data-placement='top' data-container='body' data-trigger='focus' bs-popover>

当我点击这个元素时实际上没有发生任何事情。如果我删除 data-trigger='focus' 并将其设置为 hoverclick,它确实有效。

我正在使用 angularjs。 1.2.18 和 angular-表带:2.2.4

您可以添加 tabindex 属性以使 <span> 可聚焦。这也适用于 <div><table> 元素。

The tabindex global attribute is an integer indicating if the element can take input focus (is focusable), if it should participate to sequential keyboard navigation, and if so, at what position. It can takes several values:

  • a negative value means that the element should be focusable, but should not be reachable via sequential keyboard navigation;
  • 0 means that the element should be focusable and reachable via sequential keyboard navigation, but its relative order is defined by the platform convention;
  • a positive value which means should be focusable and reachable via sequential keyboard navigation; its relative order is defined by the value of the attribute: the sequential follow the increasing number of the tabindex. If several elements share the same tabindex, their relative order follows their relative position in the

观察标记的以下变化...

<span data-content='foo' 
    data-html='true' 
    data-placement='top' 
    data-container='body' 
    data-trigger='focus' 
    bs-popover
    tabindex='0'>

MDN tabindex source

Plunker - 使用 tabindex

从文档中删除了演示