What happens
In the block editor, add a SiteOrigin Hero block, add a frame, add a button inside it, click Choose Icon. Nothing opens. Same with the Price Table block: add a column, add a feature, click Choose Icon. The icon field inside the newly added repeater item never gets data-initialized, so its click handler is never bound.
Reproduced on the 1.74.3 release build and on the published 1.74.2, both in a fresh WordPress Playground, WP 7.1. Not a regression, but the 1.74.3 changelog line "Block Editor: Fixed the icon picker not initializing in newly added or copied repeater items" claims this is fixed and it is not. That line came from commit 30db145, Step 1 of the #2334 Price Table branch, which had no issue of its own.
Why
Three things, each verified live in the editor canvas iframe:
base/inc/fields/js/icon-field.js binds sowsetupformfield to the icon field only when window.top === window.self. Inside the canvas iframe the binding is skipped. The iframe document's sowsetupformfield handlers are media, tinymce and location only. So the 30db145 change, which adds the icon field to repeaterImmediateSetupFieldSelector in base/js/admin.js and fires sowsetupformfield, cannot reach the icon field in the block editor.
- The MutationObserver in icon-field.js that is meant to cover iframes is not running: a bare
.siteorigin-widget-field-type-icon element appended to the iframe body stays uninitialised.
triggerRepeaterFieldSetup() in admin.js fires sowrepeaterfieldsadded on the iframe's document. compat/block-editor/widget-block.js listens for it on the top document under a per-block namespace. The event never crosses, so the block never re-sends the sowbBlockFormInit postMessage. Posting that message by hand initialises the new icon fields immediately and the picker opens.
Fix
Make the repeater-added signal reach the block in the canvas case, so the existing sowbBlockFormInit path re-runs ensureIconFieldsInitialized(). Either fire sowrepeaterfieldsadded on the top document as well when window.top !== window.self, or have widget-block.js listen on the canvas document. Cover it with a Playground e2e: Hero, add frame, add button, Choose Icon opens.
What happens
In the block editor, add a SiteOrigin Hero block, add a frame, add a button inside it, click Choose Icon. Nothing opens. Same with the Price Table block: add a column, add a feature, click Choose Icon. The icon field inside the newly added repeater item never gets
data-initialized, so its click handler is never bound.Reproduced on the 1.74.3 release build and on the published 1.74.2, both in a fresh WordPress Playground, WP 7.1. Not a regression, but the 1.74.3 changelog line "Block Editor: Fixed the icon picker not initializing in newly added or copied repeater items" claims this is fixed and it is not. That line came from commit 30db145, Step 1 of the #2334 Price Table branch, which had no issue of its own.
Why
Three things, each verified live in the editor canvas iframe:
base/inc/fields/js/icon-field.jsbindssowsetupformfieldto the icon field only whenwindow.top === window.self. Inside the canvas iframe the binding is skipped. The iframe document'ssowsetupformfieldhandlers are media, tinymce and location only. So the 30db145 change, which adds the icon field torepeaterImmediateSetupFieldSelectorinbase/js/admin.jsand firessowsetupformfield, cannot reach the icon field in the block editor..siteorigin-widget-field-type-iconelement appended to the iframe body stays uninitialised.triggerRepeaterFieldSetup()in admin.js firessowrepeaterfieldsaddedon the iframe'sdocument.compat/block-editor/widget-block.jslistens for it on the top document under a per-block namespace. The event never crosses, so the block never re-sends thesowbBlockFormInitpostMessage. Posting that message by hand initialises the new icon fields immediately and the picker opens.Fix
Make the repeater-added signal reach the block in the canvas case, so the existing
sowbBlockFormInitpath re-runsensureIconFieldsInitialized(). Either firesowrepeaterfieldsaddedon the top document as well whenwindow.top !== window.self, or have widget-block.js listen on the canvas document. Cover it with a Playground e2e: Hero, add frame, add button, Choose Icon opens.