From 8e54c18d0dc34336b9368bb554cf966754c7c693 Mon Sep 17 00:00:00 2001 From: laurelfulford Date: Fri, 21 Dec 2018 21:36:49 +0000 Subject: [PATCH] Twenty Nineteen: Make sure links are followed on touchend, not touchstart. The theme's original navigation JavaScript was making it so all links on a site were immediately followed on touchstart when using a touch-enabled device. This update makes sure links are followed at touchend, to improve usability and menu behavior. Already committed to the 5.0 branch in [44357]. Props anevins, panchen, kjellr. Fixes #45510. Built from https://develop.svn.wordpress.org/trunk@44358 git-svn-id: http://core.svn.wordpress.org/trunk@44188 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- .../twentynineteen/js/touch-keyboard-navigation.js | 12 +----------- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/wp-content/themes/twentynineteen/js/touch-keyboard-navigation.js b/wp-content/themes/twentynineteen/js/touch-keyboard-navigation.js index 652ff464af..a466195c16 100644 --- a/wp-content/themes/twentynineteen/js/touch-keyboard-navigation.js +++ b/wp-content/themes/twentynineteen/js/touch-keyboard-navigation.js @@ -219,19 +219,9 @@ var url = event.target.getAttribute( 'href' ) ? event.target.getAttribute( 'href' ) : ''; - // If there’s a link, go to it on touchend - if ( '#' !== url && '' !== url ) { - window.location = url; - // Open submenu if url is # - } else if ( '#' === url && event.target.nextSibling.matches('.submenu-expand') ) { - + if ( '#' === url && event.target.nextSibling.matches('.submenu-expand') ) { openSubMenu( event.target ); - - // Prevent default touch events - } else { - - event.preventDefault(); } } diff --git a/wp-includes/version.php b/wp-includes/version.php index 1a7bdaf5b6..88ff083d2f 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.1-alpha-44356'; +$wp_version = '5.1-alpha-44358'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.