Popover with `data-trigger="focus"` does not work on iOS Safari when used on <a> without `class="btn"`
See original GitHub issueAfter #11788 and #14156 the popover with data-trigger="focus"
is working very well. However, there is a super weird bug that only happens in iOS safari.
Consider the following 2 <a>
, the only difference between them is class="btn"
.
<a tabindex="0" role="button" data-toggle="popover" data-trigger="focus"
class="btn"
data-content="...">
Popover anchor w/ class 'btn'
</a>
<a tabindex="1" role="button" data-toggle="popover" data-trigger="focus"
data-content="...">
Popover anchor w/o class 'btn'
</a>
The problem is, popover works fine for the first <a>
, but not the second.
Hope the recording below will help better illustrating the problem:
Demo Plunker: http://embed.plnkr.co/M0NIAPtXOet8ppl2dShP/preview
(Please open using iPhone or iOS simulator. OSX Chrome, Android Chrome, OSX Safari, OSX Firefox works perfectly on both <a>
s.)
It seems that the focus event is somehow not triggered in iOS Safari. When I put a breakpoint in the focus event callback, the first <a>
invokes the callback as expected while the second <a>
does not.
No idea why this happens ._.
Issue Analytics
- State:
- Created 9 years ago
- Comments:22 (8 by maintainers)
@patrickhlauke
<button>
isn’t an option because of fucking Safari: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Button#Clicking_and_focus Way ahead of you on that last thing: https://github.com/necolas/normalize.css/pull/379@DavidVII That’s a very different problem. As already mentioned in the docs,
tabindex
is always required for dismiss-on-next-click popovers.