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
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user