From a907ac43b9616357217537a5f0dc78f43d9db710 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Fri, 11 Oct 2019 23:34:09 +0100 Subject: [PATCH] Remove use of 'jquery.tabIndex' This feature was copied from Vector where it was recently removed in e5c837e3ebf8. In a nut shell, HTML output from PHP generally either has no tabindex, tabindex=0 or tabindex=-1, or sometimes numbers between 1-100 for custom tab ordering. In JavaScript we then used lastTabIndex (returns highest+1) to get an input field to be at the end of the tab order. Thus making it be the *first* thing that gets focussed when pressing Tab on a page (I guess the browser offset is at the end of the document by default?) This JS-based approach wasn't very stable as it required only other thing in JS to use it for other reasons (e.g. genuinely minting normal-use tab indexes for something) to break it as we can't use the same logic for both "the lowest next number" and "the highest possible number". If we want to preserve this feature, it should probably do something like attr('tabindex', '99999') which, while ugly, would be a more sustainable way to implement this this. Per Jack Phoenix in code review on this patch, match Vector behaviour for now, where it was removed per T226148 for being contrary to accessibility best practies. Bug: T234581 Change-Id: I24777bdb6655f21d2f4896d5f887a125b36ab584 --- resources/main.js | 5 ----- skin.json | 3 --- 2 files changed, 8 deletions(-) diff --git a/resources/main.js b/resources/main.js index 9ba8fc4..f7f5e30 100644 --- a/resources/main.js +++ b/resources/main.js @@ -3,11 +3,6 @@ $( function () { // other resolutions regardless and the css overrides any visible effects. var $dropdowns = $( '#personal, #p-variants-desktop, .sidebar-chunk' ); - /** - * Focus on search box when 'Tab' key is pressed once - */ - $( '#searchInput' ).attr( 'tabindex', $( document ).lastTabIndex() + 1 ); - /** * Desktop menu click-toggling * diff --git a/skin.json b/skin.json index 1fc897e..3b38af4 100644 --- a/skin.json +++ b/skin.json @@ -63,9 +63,6 @@ "targets": [ "desktop" ], "scripts": [ "resources/main.js" - ], - "dependencies": [ - "jquery.tabIndex" ] }, "skins.timeless.mobile": {