learning-area icon indicating copy to clipboard operation
learning-area copied to clipboard

Update validation.js - fix firefox focus problem

Open RafaelGreen1 opened this issue 3 years ago • 2 comments

returning false causes the browser to not open the link which fixes the problem need to update the documentation as well

RafaelGreen1 avatar Aug 24 '20 01:08 RafaelGreen1

Any context? What is the relevant documentation?

avivmu avatar Oct 10 '20 15:10 avivmu

Any context? What is the relevant documentation?

in this article: https://developer.mozilla.org/en-US/docs/Learn/Accessibility/CSS_and_JavaScript

Note: The focus() part of this example is a bit tricky. Chrome and Edge (and newer versions of IE) will focus the element when the link is clicked, without needing the onclick/focus() block. Safari will only highlight the form element with the link on its own, so needs the onclick/focus() block to actually focus it. Firefox doesn't focus the inputs properly at all in this context, so Firefox users can't take advantage of this at present (although everything else works fine). The Firefox issue should be fixed soon — work is being done to give Firefox behaviour parity with other browsers (see bug 277178).

Thanks for looking at it

RafaelGreen1 avatar Oct 10 '20 16:10 RafaelGreen1