Selecting elements in Gutenberg toolbar

[ad_1]

I'm trying to use driver.js to create a guided tour around the Gutenberg editor for clients, but I'm having trouble finding what the correct way to query the elements is.

When I try to use querySelector it comes back null regardless of whether or not I wrap everything with a DOMContentLoaded event listener. I saw on the wp object that it has a function you can add a callback to as well called domReady, but that doesn't work either. The only thing that has worked is wrapping everything in a setTimeout to ensure that the element I'm trying to select is in the DOM.

Is there an api to get ensure I'm only getting these editor elements after they're rendered on the page? For example, how would I select the settings button in the header that pulls out the sidebar on the right side of the editor?

[ad_2]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer