0

I want to do something with the editing view DOM root that cannot be done via the engine view's API. For that, I need to access the DOM root in my plugin's init() callback.

It turns out, though, that the DOM root is created after plugins are initialized.

How can I access it from my plugin?

1 Answer 1

0

The UI is indeed initialized after plugins are initialized. See these two lines.

However, editor.ui fires the #ready event, so this will work:

editor.ui.on( 'ready', () => {
    const domRoot = editingView.getDomRoot();

    // Do something with the DOM root...
} );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.