Angular -strap data-trigger = 'focus' not working
trick data-trigger
doesn't work for me ...
<span data-content='foo' data-html='true' data-placement='top' data-container='body' data-trigger='focus' bs-popover>
Nothing actually happens when I click on this element. If I remove data-trigger='focus'
and put it on hover
or click
it works.
I am using angularjs. 1.2.18 and angular-strap: 2.2.4
source to share
You can add an attribute tabindex
to make it <span>
focus. This also applies to elements <div>
and <table>
.
The global tabindex attribute is an integer indicating whether the element can receive input focus (focus), if it should participate in sequential keyboard navigation, and if so, in what position. It can take several values:
- a negative value means that the element should be customizable, but should not be reachable through sequential keyboard navigation;
- 0 means the element should be focusable and reachable through sequential keyboard navigation, but its relative order is determined by platform convention;
- a positive value, which means must be focusable and achievable through sequential keyboard navigation; its relative order is determined by the value of the attribute: successive ones follow the increasing number of tabindex. If multiple elements have the same tabindex, their relative order follows their relative position in
Observe the following change to your markup ...
<span data-content='foo'
data-html='true'
data-placement='top'
data-container='body'
data-trigger='focus'
bs-popover
tabindex='0'>
Plunker - removed demo from docs usingtabindex
source to share