Skip to content

Commit 999fad6

Browse files
committed
Loader: Fix loader callback timing
This is a followup to 754f101 to make sure that we wait for the `.metabox-location-normal` form to be moved into `.edit-post-meta-boxes-area__container` in the block editor before running our loading callbacks. Otherwise, there is the possibility that the callbacks will still fire too early, before the FM forms are ready.
1 parent 12f37da commit 999fad6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

js/fieldmanager-loader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function fmLoadModule( callback ) {
2626
*/
2727
if (
2828
wp.data.select( 'core/edit-post' ).areMetaBoxesInitialized()
29-
&& document.querySelector( '.edit-post-meta-boxes-area__container' )
29+
&& document.querySelector( '.edit-post-meta-boxes-area__container .metabox-location-normal' )
3030
) {
3131
callback();
3232
unsubscribeListener();

0 commit comments

Comments
 (0)