From 977453d35a2a0976a6d15b9c2e3f495f99b02c2f Mon Sep 17 00:00:00 2001 From: Matthias Kittsteiner Date: Mon, 17 Jun 2024 09:57:35 +0200 Subject: [PATCH] =?UTF-8?q?=E2=99=BF=EF=B8=8F=20Allow=20submitting=20wizar?= =?UTF-8?q?d=20on=20enter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/form/wizard.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/form/wizard.js b/src/form/wizard.js index 3f455d7..3c2fef2 100644 --- a/src/form/wizard.js +++ b/src/form/wizard.js @@ -229,6 +229,12 @@ export default function Wizard( props ) { setIsWizardOpen( false ); }; + const onKeyPress = ( event ) => { + if ( event.key === 'Enter' ) { + onInsert(); + } + } + return ( setFields( fields ) } + onKeyPress={ onKeyPress } />