mcguffin / acf-openstreetmap-field

WordPress ACF Field for OpenStreetMap
https://wordpress.org/plugins/acf-openstreetmap-field/
GNU General Public License v3.0
107 stars 21 forks source link

TypeError: t.get(...).dispatchEvent is not a function #93

Closed gnndev closed 9 months ago

gnndev commented 1 year ago

Hi, I'm randomly getting the attacched error when switching a gutenberg block made with acf from edit to preview mode. I'm using acf pro 6.0.6 and wp 6.1.1 Step to reproduce. Create a gutenberg custom block with acf, ie:

$title= get_field( 'title' );
?>

<div>
    <div class="pt-6 md:pt-8 pb-2">
        <h2><?php echo ($title) ? $title: 'News'; ?></h2>
    </div>

</div>

Add the block into a page, change the title and switch from edit to preview mode. Repeat few times The block crash.

The issue seems to be in acf-input-osm.js `acf.addAction( 'append', function( $el ){ $el.length && $el.get(0).dispatchEvent( new CustomEvent('acf-osm-map-added') ); });

fir.local-1672323885945.log

aferrato commented 1 year ago

I have the same issue, any solutions?

kimhf commented 1 year ago

I'm seeing the same issue after implementing a block with this field type.

mcguffin commented 9 months ago

Should be fixed in 1.5.0. (Otherwise please move over to #100 … I'll keep this open)