-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Hide insertion point if a template lock exists. #5574
Hide insertion point if a template lock exists. #5574
Conversation
@@ -439,7 +439,7 @@ export class BlockListBlock extends Component { | |||
// Insertion point can only be made visible when the side inserter is | |||
// not present, and either the block is at the extent of a selection or | |||
// is the last block in the top-level list rendering. | |||
const shouldShowInsertionPoint = ( | |||
const shouldShowInsertionPoint = ! isLocked && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the block movers, we assign shouldShowMovers
without consideration of isLocked
, and this consideration is managed by the BlockMover
component itself. Should we do that here? Or at least align the two approaches one way or the other?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we should be consistent, I updated the code to follow the same logic we now do the check for template locking inside BlockInsertionPointm, like we do for BlockMover.
85eee73
to
e466394
Compare
The insertion point allows inserting a new block by clicking on it, when a template lock exists, insertion should not be possible.
e466394
to
127129f
Compare
@janeschindler This was merged five days ago and hasn't yet landed in a Gutenberg plugin release, so I wouldn't expect you should see any difference yet. Gutenberg 5.6.0 will be released on Wednesday. If you are still having problems after the testing again the latest version, I'd recommend you open a new issue, as it will be the easiest way to track further improvements. |
The insertion point allows inserting a new block by clicking on it, when a template lock exists, insertion should not be possible.
Fixes: #5531
How Has This Been Tested?
Define a CPT with a template lock, verify it is not possible to insert block using the insertion point inserter if a template lock exists.