From dec3f13bac01922cbc103b3fc1add84a25300a78 Mon Sep 17 00:00:00 2001 From: Joe Dolson Date: Thu, 24 Feb 2022 04:33:47 +0000 Subject: [PATCH] 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 --- src/js/media/views/frame/edit-attachments.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/media/views/frame/edit-attachments.js b/src/js/media/views/frame/edit-attachments.js index 1351a31083..5273046935 100644 --- a/src/js/media/views/frame/edit-attachments.js +++ b/src/js/media/views/frame/edit-attachments.js @@ -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; }