-
-
Notifications
You must be signed in to change notification settings - Fork 660
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Title block doesn't respect "Disable new blocks" restriction from DX Layout #6306
Comments
Hi @avoinea , i came across the same issue! you got any lead on fixing it? |
@MAX-786 Here is a starting point volto/packages/volto/src/components/manage/Blocks/Block/Edit.jsx Lines 176 to 186 in 157df05
|
vs
|
thanks @avoinea and I looked briefly and i think problem for Title Block lies here:
So, i don't have solid idea about 'detached' but i think it checks for 'blockHasOwnFocusManagement', i might be wrong but doesn't matter and the solution would be simple with jsut adding new flag like 'disableNewBlocksByDefault' and check for both flags like const disableNewBlocksByDefault = useMemo(() => data?.disableNewBlocks, [data?.disableNewBlocks]); And check for it here: volto/packages/volto/src/components/manage/Blocks/Title/Edit.jsx Lines 107 to 111 in 157df05
Now for Text Block, i think it has to do with slate because if you enter when its empty and 'disableNewBlocks' is true, it removes the block itself instead of doing 'nothing' and when you type in something and press enter it adds new block which it should not. |
Describe the bug
Title-Layout.webm
To Reproduce
Expected behavior
A new block should not be created when you press Enter in the Title block if it has "Disable new blocks"
Screenshots
If applicable, add screenshots to help explain your problem.
Software (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: