Make WordPress Core

Changeset 40568


Ignore:
Timestamp:
05/02/2017 08:02:49 PM (7 years ago)
Author:
afercia
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/options.php

    r36416 r40568  
    5454                $( "input[name='date_format_custom']" ).val( $( this ).val() ).siblings( '.example' ).text( $( this ).parent( 'label' ).children( '.format-i18n' ).text() );
    5555        });
    56         $("input[name='date_format_custom']").focus(function(){
     56        $( 'input[name="date_format_custom"]' ).on( 'click input', function() {
    5757            $( '#date_format_custom_radio' ).prop( 'checked', true );
    5858        });
     
    6262                $( "input[name='time_format_custom']" ).val( $( this ).val() ).siblings( '.example' ).text( $( this ).parent( 'label' ).children( '.format-i18n' ).text() );
    6363        });
    64         $("input[name='time_format_custom']").focus(function(){
     64        $( 'input[name="time_format_custom"]' ).on( 'click input', function() {
    6565            $( '#time_format_custom_radio' ).prop( 'checked', true );
    6666        });
Note: See TracChangeset for help on using the changeset viewer.