Detect when gutenberg editor title is available in Dom after editor load

Adding inline CSS on an element with style=".." is bad practice, people say to use a CSS rule in a stylesheet instead, via a HTML class. So it doesn’t make much sense to start styling things manually via javascript like that.

Instead, wouldn’t it make more sense to add a stylesheet that hides the title, then shows it when a CSS class is added to the main editor tag? Then add the class when your event is selected from the dropdown?

Additionally, you shouldn’t be doing this:

select("core/editor").loadedInit = true;

If you want to store data, there’s the WP Data API for that, and other alternatives.

Also, don’t use setTimeout, use the window._wpLoadBlockEditor promise to queue stuff up to run after the editor has been initialised instead, e.g.

window._wpLoadBlockEditor.then( function() {
    console.log( 'hooray!' );
});