Skip to content

Commit

Permalink
♿️ Allow submitting wizard on enter
Browse files Browse the repository at this point in the history
  • Loading branch information
MatzeKitt committed Jun 17, 2024
1 parent 8183074 commit 977453d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/form/wizard.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,12 @@ export default function Wizard( props ) {
setIsWizardOpen( false );
};

const onKeyPress = ( event ) => {
if ( event.key === 'Enter' ) {
onInsert();
}
}

return (
<Modal
className="form-block__wizard-modal"
Expand All @@ -239,6 +245,7 @@ export default function Wizard( props ) {
help={ __( 'Define the field labels of the fields you need. Separate multiple field labels with a comma. Add an * to a label to automatically mark the field as required.', 'form-block' ) }
label={ __( 'Which form fields do you need?', 'form-block' ) }
onChange={ ( fields ) => setFields( fields ) }
onKeyPress={ onKeyPress }
/>
<ToggleControl
checked={ includeConsentCheckbox }
Expand Down

0 comments on commit 977453d

Please sign in to comment.