From e2f114db087134fab57103ae55f91dbdec8d9119 Mon Sep 17 00:00:00 2001 From: audrasjb Date: Wed, 21 Jun 2023 21:32:25 +0000 Subject: [PATCH] Twenty Nineteen: Prevent a console error related to the main navigation on Firefox. This changeset improves a JS conditional statement to fix a console error thrown by Firefox on `event.target.matches`. Props kjellr, laurelfulford, audrasjb, dimijazz, ianbelanger, pbiron, poena, McAlyster, janpaulkleijn, swissspidy, mukesh27, rehanali. Fixes #46474. See #45903 (fixes one of the two issues of this ticket). Built from https://develop.svn.wordpress.org/trunk@55970 git-svn-id: http://core.svn.wordpress.org/trunk@55482 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- .../themes/twentynineteen/js/touch-keyboard-navigation.js | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-content/themes/twentynineteen/js/touch-keyboard-navigation.js b/wp-content/themes/twentynineteen/js/touch-keyboard-navigation.js index c8d1dd02e6..073102fe23 100644 --- a/wp-content/themes/twentynineteen/js/touch-keyboard-navigation.js +++ b/wp-content/themes/twentynineteen/js/touch-keyboard-navigation.js @@ -274,7 +274,7 @@ document.addEventListener('focus', function(event) { - if ( event.target.matches('.main-navigation > div > ul > li a') ) { + if ( event.target != window.document && event.target.matches( '.main-navigation > div > ul > li a' ) ) { // Remove Focused elements in sibling div. var currentDiv = getCurrentParent( event.target, 'div', '.main-navigation' ); diff --git a/wp-includes/version.php b/wp-includes/version.php index d673883e3b..872278bea8 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.3-alpha-55969'; +$wp_version = '6.3-alpha-55970'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.