Make WordPress Core

Changeset 40897


Ignore:
Timestamp:
06/12/2017 02:08:34 PM (7 years ago)
Author:
afercia
Message:

Accessibility: Avoid a keyboard trap on the permalink custom structure setting.

Using the focus event on the permalink custom structure field made impossible
to navigate through all the form fields using only the keyboard without actually
selecting the custom structure setting. Instead, using click and input preserves
the original functionality when using any kind of pointing or input device.

Also changes attr() to prop() as recommended for a checked` property.

Fixes #40982.

File:
1 edited

Legend:

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

    r40579 r40897  
    101101        jQuery('#permalink_structure').val( this.value );
    102102    });
    103     jQuery('#permalink_structure').focus(function() {
    104         jQuery("#custom_selection").attr('checked', 'checked');
     103    jQuery( '#permalink_structure' ).on( 'click input', function() {
     104        jQuery( '#custom_selection' ).prop( 'checked', true );
    105105    });
    106106});
Note: See TracChangeset for help on using the changeset viewer.