initialize Interactivity API directives on asyncronously loaded content #63521
Replies: 1 comment 1 reply
-
Hi there! I'm afraid there is no way to run Interactivity API on demand. The API is not yet ready for AJAX loaded content (SPA like) unless you use For that to work, you need to define a router region and only have static HTML or Interactivity based interactive HTML. If you have custom blocks, you need to define its compatibility with block supports. You can check The team is still working to find the best approach to deal with injected content, but is a tricky issue, as we cannot know what JS will need to be executed after an HTML injection. |
Beta Was this translation helpful? Give feedback.
-
Is there a way to initialize Interactivity API directives on late/ajax loaded content?
The source script appears to only run one time, asyncronously, on DOMContentLoaded.
For context, I am rendering an inner block inside the WooCommerce cart block... but that is actually front-end rendered. So far, I haven't been able to get the Interactivity directives to initialize on my inner block even though the script is loaded.
Beta Was this translation helpful? Give feedback.
All reactions