From e88ec329f7d36ba1d1a01f3c4dafc3a0e166f26b Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 10 Jul 2017 23:16:32 +0000 Subject: [PATCH] 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. Props afercia. Fixes #40982. Merges [40897] to the 4.8 branch. Built from https://develop.svn.wordpress.org/branches/4.8@41024 git-svn-id: http://core.svn.wordpress.org/branches/4.8@40874 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/options.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/options.php b/wp-admin/includes/options.php index a085a4ad5c..6b8114d571 100644 --- a/wp-admin/includes/options.php +++ b/wp-admin/includes/options.php @@ -100,8 +100,8 @@ jQuery(document).ready(function() { return; jQuery('#permalink_structure').val( this.value ); }); - jQuery('#permalink_structure').focus(function() { - jQuery("#custom_selection").attr('checked', 'checked'); + jQuery( '#permalink_structure' ).on( 'click input', function() { + jQuery( '#custom_selection' ).prop( 'checked', true ); }); });