Reputation: 4319
I want to use AngularStrap Popover to trigger a popover from a text element. Is it possible to trigger a popover from an anchor? Or a span element or such?
This works:
<button content="hello" trigger="focus" bs-popover>clickme</button>
But this doesn't:
<a href="" content="hello" trigger="focus" bs-popover>clickme</a>
<span href="" content="hello" trigger="focus" bs-popover>clickme</span>
<label href="" content="hello" trigger="focus" bs-popover>clickme</label>
<small href="" content="hello" trigger="focus" bs-popover>clickme</small>
I can't find an example of how to do it was an anchor - and neither whether it is possible or not. (span element any other lablelike element would also go, but no button .....) Seems like a quite stupid question to me, but I really couldn't find an proper answer :/
Thanks very much!
Upvotes: 0
Views: 1334
Reputation: 1317
Try setting the tab index on your anchor tag like so:
<a tabindex="0" href="" content="hello" trigger="focus" bs-popover>clickme</a>
See this discussion and this analysis of clicking / focusing on anchor tags in different browsers.
Upvotes: 0
Reputation: 3726
The problem is that trigger='focus'
works for focusable elements; button is focusable, anchors and spans are not. Try trigger='hover'
, or trigger='click'
You can check my plunker:
http://plnkr.co/edit/4oi1ucgQa6zqhQSlVhzu
Upvotes: 1