I have an application that is programmatically setting focus on elements in certain situations. Mostly it all works fine, but when I set the focus on an anchor, e.g. $("#link1").focus(), I don't see the focus outline in Firefox (v42.0). The focus IS on the element as I can tab to the next and see the outline. When I then tab back, I see the outline on my original element correctly. It works correctly on Chrome and IE.
If, after setting the focus, I switch to another tab in Firefox and back, the outline is shown.
It looks like the element isn't getting refreshed correctly when I call focus().
The HTML and JS/jQuery are pretty simple:
<a href="#" id="link1">Link 1</a>
<a href="#" id="link2">Link 2</a>
$("#link1").click(function(evt){
evt.preventDefault();
$("#link2").focus();
});
Anyone have any ideas?
http://jsfiddle.net/4xkh9y1o/1/
Thanks,
Steven