@atlaskit/modal-dialog focus/accessibility issue

When closing a ModalDialog, focus is set to the last element that was focused before opening the modal.
It’s causing page to scroll to this element.
It seems like a trial to improve accessibility of modals, but for user using a mouse it produces a weird behaviour:

  1. User clicks on some input, focusing it,
  2. User performs some activities that do not change which element is focused,
  3. User opens a ModalDialog,
  4. User closes a ModalDialog,
  5. Input (from point 1) is focused back and the page is scrolled to it.

If no element is focused before opening a modal, but PageLayout from @atlaskit/page-layout is used, the page is scrolled up to the top.

The issue can be observed on https://atlassian.design/components/modal-dialog/examples:

  1. Press Show More in the Default section
  2. Scroll down to From section
  3. Open & close the modal in the From section
    The page is scrolled up to Show More in the Default section

The functionality seems important for users using keyboard to navigate on a page, but should be disabled if mouse is used to open a modal.