From 1ca3b70929fe0105aef551b933e2dae16ae6e3cf Mon Sep 17 00:00:00 2001 From: Andrea Fercia Date: Tue, 2 May 2017 20:03:42 +0000 Subject: [PATCH] Accessibility: Avoid a keyboard trap on the date and time custom format settings. Using the `focus` event on the date and time custom format fields made impossible to navigate through all the form fields using only the keyboard without actually selecting the custom format setting. Instead, using `click` and `input` preserves the original functionality when using any kind of pointing or input device. Fixes #40515. Built from https://develop.svn.wordpress.org/trunk@40568 git-svn-id: http://core.svn.wordpress.org/trunk@40436 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/options.php | 4 ++-- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-admin/includes/options.php b/wp-admin/includes/options.php index 95d9964e9e..14c175de23 100644 --- a/wp-admin/includes/options.php +++ b/wp-admin/includes/options.php @@ -53,7 +53,7 @@ function options_general_add_js() { if ( "date_format_custom_radio" != $(this).attr("id") ) $( "input[name='date_format_custom']" ).val( $( this ).val() ).siblings( '.example' ).text( $( this ).parent( 'label' ).children( '.format-i18n' ).text() ); }); - $("input[name='date_format_custom']").focus(function(){ + $( 'input[name="date_format_custom"]' ).on( 'click input', function() { $( '#date_format_custom_radio' ).prop( 'checked', true ); }); @@ -61,7 +61,7 @@ function options_general_add_js() { if ( "time_format_custom_radio" != $(this).attr("id") ) $( "input[name='time_format_custom']" ).val( $( this ).val() ).siblings( '.example' ).text( $( this ).parent( 'label' ).children( '.format-i18n' ).text() ); }); - $("input[name='time_format_custom']").focus(function(){ + $( 'input[name="time_format_custom"]' ).on( 'click input', function() { $( '#time_format_custom_radio' ).prop( 'checked', true ); }); $("input[name='date_format_custom'], input[name='time_format_custom']").change( function() { diff --git a/wp-includes/version.php b/wp-includes/version.php index b8cffd21f1..ddfa685d37 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.8-alpha-40567'; +$wp_version = '4.8-alpha-40568'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.