Skip to content

Commit

Permalink
Form Block: prioritize form elements in form block inserter
Browse files Browse the repository at this point in the history
Fixes #31716
  • Loading branch information
jeherve committed Nov 22, 2023
1 parent d0612a4 commit 16569de
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Forms Block: prioritize the use of form elements in the block inserter inside form blocks.
8 changes: 7 additions & 1 deletion projects/packages/forms/src/blocks/contact-form/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ const ALLOWED_BLOCKS = [
'core/video',
];

const PRIORITIZED_INSERTER_BLOCKS = [ ...map( validFields, block => `jetpack/${ block.name }` ) ];

const RESPONSES_PATH = `${ get( getJetpackData(), 'adminUrl', false ) }edit.php?post_type=feedback`;
const CUSTOMIZING_FORMS_URL = 'https://jetpack.com/support/jetpack-blocks/contact-form/';

Expand Down Expand Up @@ -343,7 +345,11 @@ export const JetpackContactFormEdit = forwardRef(
</InspectorControls>

<div className={ formClassnames } style={ style } ref={ ref }>
<InnerBlocks allowedBlocks={ ALLOWED_BLOCKS } templateInsertUpdatesSelection={ false } />
<InnerBlocks
allowedBlocks={ ALLOWED_BLOCKS }
prioritizedInserterBlocks={ PRIORITIZED_INSERTER_BLOCKS }
templateInsertUpdatesSelection={ false }
/>
</div>
</>
);
Expand Down

0 comments on commit 16569de

Please sign in to comment.