From 8b6b1cababf4431fb5711be40a881e15db31c3eb Mon Sep 17 00:00:00 2001 From: Rob Gietema Date: Sat, 5 Oct 2024 14:02:03 +0200 Subject: [PATCH] Add disable enter setting. --- .../volto/src/components/manage/Blocks/Block/BlocksForm.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/volto/src/components/manage/Blocks/Block/BlocksForm.jsx b/packages/volto/src/components/manage/Blocks/Block/BlocksForm.jsx index 65d3f6fb0d..4466bb8da1 100644 --- a/packages/volto/src/components/manage/Blocks/Block/BlocksForm.jsx +++ b/packages/volto/src/components/manage/Blocks/Block/BlocksForm.jsx @@ -106,7 +106,11 @@ const BlocksForm = (props) => { onFocusNextBlock(block, node, isMultipleSelection); e.preventDefault(); } - if (e.key === 'Enter' && !disableEnter) { + + const blockConfig = + blocksConfig[properties[getBlocksFieldname(properties)][block]['@type']]; + + if (e.key === 'Enter' && !disableEnter && !blockConfig.disableEnter) { if (!disableAddBlockOnEnterKey) { onSelectBlock(onAddBlock(config.settings.defaultBlockType, index + 1)); }