title: Gutenberg editor scroll block into view
body: <p>How can I scroll a newly inserted block into the view in the wordpress gutenberg editor?</p>
  
  <p>I am creating the block with</p>
  
  <pre><code>const nextBlock = createBlock( 'core/paragraph' );
  wp.data.dispatch( 'core/editor' ).insertBlock( nextBlock );
  //scroll the block into the view
  </code></pre>
  
  <p>I have also seen that gutenberg uses the <code>dom-scroll-into-view</code> package like e.g. <a href="https://github.com/WordPress/gutenberg/blob/7964f381e07e06b2ac13698fd1465a4d0c16da1b/packages/block-editor/src/components/inserter/menu.js#L18" rel="nofollow noreferrer">here</a>.</p>
  
  <p>Their documentation says:</p>
  
  <pre><code>var scrollIntoView = require('dom-scroll-into-view');
  scrollIntoView(source,container,config);
  </code></pre>
  
  <p>but how can I get it working in my case, how to get the source and container DOM elements?</p>