-
Notifications
You must be signed in to change notification settings - Fork 194
Description
Describe the bug
In our custom block work, we lock post saving when certain required fields are empty using lockPostSaving() like so:
dispatch('core/editor').lockPostSaving('our-theme-custom-lock-id');
This causes the ACF block V3 expanded modal to lock, preventing dismissal.
To Reproduce
Steps to reproduce the behavior:
- Add editor JS to lock the post editor using a custom lock, or try this in the browser console with the WP editor open:
window.wp.data.dispatch('core/editor').lockPostSaving('my-example-lock-id');. This should lock post saving/publishing. - Select an ACF block and click the "Open Expanded Editor" button to expand the ACF block form modal.
- Attempt to click the modal dismiss button labeled "done" or otherwise attempt to dismiss and close the modal to return to the editor.
Expected behavior
We would expect that locking post saving does not lock the ACF expanded edit modal, and that this modal is dismissible even if post saving is locked. This issue prevents users from closing the modal and addressing anything else in the editor.
Code
Relevant example block.json below. I found that no fields need to be registered to the block. The modal cannot be dismissed regardless of the block's registered fields.
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"title": "Example Block",
"textdomain": "my-custom-domain",
"name": "myplugin/myblockname",
"icon": "feedback",
"category": "text",
"acf": {
"blockVersion": 3,
"renderTemplate": "template.php"
},
"style": "file:./style.min.css"
}Version Information:
- WP version 6.9.4
- PHP version 8.4
- ACF Pro 6.7.1
