From 301248d5e7b2bb59b2e0d99ca9a6997eff61dcdd Mon Sep 17 00:00:00 2001 From: Ismail El Korchi Date: Thu, 7 May 2020 05:09:46 +0000 Subject: [PATCH] Remove the skip link focus fix (#1424) --- functions.php | 2 -- js/skip-link-focus-fix.js | 31 ------------------------------- 2 files changed, 33 deletions(-) delete mode 100644 js/skip-link-focus-fix.js diff --git a/functions.php b/functions.php index 331f1926..d083326a 100644 --- a/functions.php +++ b/functions.php @@ -148,8 +148,6 @@ function _s_scripts() { wp_enqueue_script( '_s-navigation', get_template_directory_uri() . '/js/navigation.js', array(), _S_VERSION, true ); - wp_enqueue_script( '_s-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), _S_VERSION, true ); - if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } diff --git a/js/skip-link-focus-fix.js b/js/skip-link-focus-fix.js deleted file mode 100644 index bf9367e0..00000000 --- a/js/skip-link-focus-fix.js +++ /dev/null @@ -1,31 +0,0 @@ -/** - * File skip-link-focus-fix.js. - * - * Helps with accessibility for keyboard only users. - * - * Learn more: https://git.io/vWdr2 - */ -( function() { - var isIe = /(trident|msie)/i.test( navigator.userAgent ); - - if ( isIe && document.getElementById && window.addEventListener ) { - window.addEventListener( 'hashchange', function() { - var id = location.hash.substring( 1 ), - element; - - if ( ! ( /^[A-z0-9_-]+$/.test( id ) ) ) { - return; - } - - element = document.getElementById( id ); - - if ( element ) { - if ( ! ( /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) ) ) { - element.tabIndex = -1; - } - - element.focus(); - } - }, false ); - } -}() );