![](https://secure.gravatar.com/avatar/4592155221400d7f913a1cccb9f0e9f4?s=64&d=mm&r=g)
Hello,
There is a bug in the ACF PRO Version 5.8.3 with Gutenberg (WordPress 5.2.2) that wasn’t there in beta (Version 5.8.0-beta4.1).
When you add styles to the block via wp.blocks.registerBlockStyle, the preview/edit functionality doesn’t work: the edit UI doesn’t load after switching styles and previewing block.
I’m attaching the gif with bug recording.
Code registering block:
// spoiler popup
acf_register_block(
array(
'name' => 'ma_spoiler_popup',
'title' => __( 'Toggle Popup' ),
'description' => __( 'A custom block for adventskalender hidden content inside popup' ),
'render_callback' => [ 'MA_Editor_Blocks', 'acf_block_render_callback' ],
'category' => 'advents',
'icon' => 'editor-expand',
'keywords' => array( 'popup', 'spoiler', 'accordion' ),
'mode' => 'edit',
'supports' => [
'align' => false,
],
)
);
Render template:
<?php
/**
* Block : Spoiler Popup
*/
$intro = get_field( 'intro_line' );
$button_text = ( get_field( 'button_text' ) ) ? get_field( 'button_text' ) : '+';
$content = get_field( 'popup_content' );
$class = ( isset( $block['className'] ) ) ? $block['className'] : '';
?>
<div class="<?php echo esc_attr( $class ); ?>">
<p class="popup__intro">
<span><?php echo esc_html( $intro ); ?></span>
<span class="botton_cls" data-popup-trigger="<?php echo esc_attr( $block['id'] ); ?>"><span class="botton_cls__inner"><?php echo esc_html( $button_text ); ?></span></span>
</p>
<div class="popup__hidden" data-popup="<?php echo esc_attr( $block['id'] ); ?>">
<?php echo do_shortcode( wp_kses_post( $content ) ); ?>
</div>
</div>
Breaking bug, still present in 5.8.4
Any comment as to when we can expect a fix for this?
Hi all,
Elliot here – ACF dev.
I was made aware of this forum thread via the following GitHub issue: https://github.com/AdvancedCustomFields/acf/issues/246#event-2786440261
Please join me on GitHub to discuss replicating this issue so I may debug the problem.
Thanks
Elliot