When adding a section to the page in the theme editor, scripts are not run until the page is saved. For example, the follow code will not log anything until the page has been saved. It then works great and the listener handles updates etc. But on section add - nothing.
What can I do to get code to run on “add” - otherwise I can’t let users preview what a section will look like without them pressing save first, which seems wrong