We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 230a2fa commit cd9a556Copy full SHA for cd9a556
js/a11y.js
@@ -730,6 +730,12 @@ class A11y extends Backbone.Controller {
730
focusFirst($element, options) {
731
options = new FocusOptions(options);
732
$element = $($element).first();
733
+ const isBodyFocus = ($element[0] === document.body);
734
+ if (isBodyFocus) {
735
+ // force focus to the body, effectively starting the tab cursor from the top
736
+ this.focus($element, options);
737
+ return;
738
+ }
739
if (this.isReadable($element)) {
740
this.focus($element, options);
741
return $element;
0 commit comments