A:focus behavior change?

By default, a link on a web page acknowledges when it has focus usually by sprouting a dotted outline or border (great for keyboarders). Once upon a time, another benefit of the focus indicator was that after one clicked the link and went to another page (in the same window/tab), then returned by clicking the Back button on the browser, the focus indicator was still visible on the first page so the user could quickly tell which link they had clicked to leave the page.

That latter behavior does not seem to be true any longer. Once one leaves a page, the object that had focus on that page (the link) seems to be forgotten. Returning via the Back button no longer indicates the link that one clicked to go to the other page.

I just discovered this in FF and confirmed it in Chrome.

I’m puzzlied because I don’t know when this change happened or why? I imagine it changed for reasons of security, but that’s just a guess. Can anyone shed some light on this for me?

Yes, it no longer indicates the link that had focus, and the link no longer has the focus, either. It’s as if the page has entirely refreshed. Pity, really.

They should have the “visited” style no?

So browsers are going back based on the URL instead of reloading the page in the state it was in when it was left (i.e. from cache)?

Yes, once visited, links should have the :visited style. It appears that :focus is remembered now only when current page on-page targets (fragment identifiers) are targeted. Leave the page and the link that was clicked loses :focus… which didn’t used to be the case.

For me personally, that change/loss is more than just a pity.

I don’t believe so. I believe that browsers are simply not “remembering” the :focus state of the last element clicked (the anchor) when one leaves the page.

Stomme Poes talks about this in the comments on this article from 2 years ago so it has been happening for some time.

My Firefox (latest version PC) shows the focus on the link when you use the back button.

1 Like

Indeed, so does mine, today… after closing FF completely and restarting it…

If the behavior were happening in FF and Chrome, I felt that it had be an old issue that was just now being “addressed” in FF. I am glad to find out that the “addressed in FF” part was wrong. … for the time being, anyway.

Thank you for the link to the SP article.

I did not realize that there is such disharmony between browsers regarding focus behavior icw mouse vs touch.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.