From 228ab3aa8ce5ae1578ddd6980ecceab63ce2ae3f Mon Sep 17 00:00:00 2001 From: Aki Hamano <54422211+t-hamano@users.noreply.github.com> Date: Tue, 24 Sep 2024 19:28:36 +0900 Subject: [PATCH] Resizable Editor: Make the editor resizable with arrow keys (#65546) Co-authored-by: t-hamano Co-authored-by: kevin940726 --- .../editor/src/components/resizable-editor/resize-handle.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/editor/src/components/resizable-editor/resize-handle.js b/packages/editor/src/components/resizable-editor/resize-handle.js index dbba31f6f998ba..ccd903d0f3a172 100644 --- a/packages/editor/src/components/resizable-editor/resize-handle.js +++ b/packages/editor/src/components/resizable-editor/resize-handle.js @@ -15,6 +15,11 @@ export default function ResizeHandle( { direction, resizeWidthBy } ) { function handleKeyDown( event ) { const { keyCode } = event; + if ( keyCode !== LEFT && keyCode !== RIGHT ) { + return; + } + event.preventDefault(); + if ( ( direction === 'left' && keyCode === LEFT ) || ( direction === 'right' && keyCode === RIGHT )