As noted in #806, the pattern used for many of the Shortcake attribute fields which output custom field templates is to output those templates on the shortcode_ui_loaded_editor hook. In WP 5.0 with the block editor active, this hook fires before the page output is begun, which causes these script templates to be spit out before the opening tag, causing all kinds of ruckus with the browser layout.
Specifically, any output before the declaration forces browsers into quirks mode, which renders the flex layout required for the Gutenberg editor incorrectly. In practive this was causing meta boxes to float awkwardly over editor content.
This fixes the problem by, instead of outputting the templates on the shortcode_ui_loaded_editor hook, instead attaching a hook to a later action to output these templates in the admin footer.
As noted in #806, the pattern used for many of the Shortcake attribute fields which output custom field templates is to output those templates on the tag, causing all kinds of ruckus with the browser layout.
shortcode_ui_loaded_editor
hook. In WP 5.0 with the block editor active, this hook fires before the page output is begun, which causes these script templates to be spit out before the openingSpecifically, any output before the declaration forces browsers into quirks mode, which renders the flex layout required for the Gutenberg editor incorrectly. In practive this was causing meta boxes to float awkwardly over editor content.
This fixes the problem by, instead of outputting the templates on the
shortcode_ui_loaded_editor
hook, instead attaching a hook to a later action to output these templates in the admin footer.