Home › Forums › Gutenberg › Dispatch Javascript event on acf/ajax/render_block_preview success › Reply To: Dispatch Javascript event on acf/ajax/render_block_preview success
Actually, I spoke too soon. Looks like there is already a JS event in ACF Pro for handline this situation. The event is:
render_block_preview
It passes two arguments, the element as a jQuery object and details about the block (name, content, mode, etc…). I put together a quick example usage here:
https://gist.github.com/hereswhatidid/a67dc3697a481c223bdced42586f6664
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.