Media: Stop arrow keys switching media if URL focused.

Keyboard handlers were prevented from navigating attachments in input fields, but the key handler excluded readonly fields, like the media URL field. This could prevent exploring the URL using the keyboard.

Props jrivett, joemcgill, afercia.
Fixes #43202.


git-svn-id: https://develop.svn.wordpress.org/trunk@52792 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Joe Dolson 2022-02-24 04:33:47 +00:00
parent 44ec790fe6
commit dec3f13bac

View File

@ -251,7 +251,7 @@ EditAttachments = MediaFrame.extend(/** @lends wp.media.view.MediaFrame.EditAtta
* focus is in a textarea or input field.
*/
keyEvent: function( event ) {
if ( ( 'INPUT' === event.target.nodeName || 'TEXTAREA' === event.target.nodeName ) && ! ( event.target.readOnly || event.target.disabled ) ) {
if ( ( 'INPUT' === event.target.nodeName || 'TEXTAREA' === event.target.nodeName ) && ! event.target.disabled ) {
return;
}