In the context of ACF blocks, rendered content being updated triggers the "append" action, but with a React component as the argument. React components don't have dispatchEvent (they're not DOM elements), so this function call errors and causes the block to fail to render. This change simply checks whether dispatchEvent exists before calling it.
If the argument to the "append" action is indeed an error in ACF, then if/when it gets fixed, this event will be properly dispatched again. Until then, it will simply do nothing when it would otherwise fail, which is at least an incremental improvement.
In the context of ACF blocks, rendered content being updated triggers the "append" action, but with a React component as the argument. React components don't have
dispatchEvent
(they're not DOM elements), so this function call errors and causes the block to fail to render. This change simply checks whetherdispatchEvent
exists before calling it.If the argument to the "append" action is indeed an error in ACF, then if/when it gets fixed, this event will be properly dispatched again. Until then, it will simply do nothing when it would otherwise fail, which is at least an incremental improvement.
Fixes #100