How can I scroll a newly inserted block into the view in the wordpress gutenberg editor?
I am creating the block with
const nextBlock = createBlock( 'core/paragraph' );
wp.data.dispatch( 'core/editor' ).insertBlock( nextBlock );
//scroll the block into the view
I have also seen that gutenberg uses the dom-scroll-into-view package like e.g. here.
Their documentation says:
var scrollIntoView = require('dom-scroll-into-view');
scrollIntoView(source,container,config);
but how can I get it working in my case, how to get the source and container DOM elements?