MUI Menu in an iframe scrolls the page around it

@mui/material 9.5.0 focuses a Menu's first row before Popover moves the menu beside its button. Firefox scrolls the page around an iframe to show a focused element, so this page jumps.

Mode: MUI default · With the workaround (JBrowse's version) · Source

To reproduce, in Firefox

  1. Press this button. It scrolls the yellow bar at the top of the dashed iframe off the top of the window, then opens the menu in the iframe.

  2. The page snaps back up until the yellow bar is on screen, and a result box at the bottom right says how far the page jumped. The menu you opened is now below the window.
  3. Switch to With the workaround and run it again: the page stays put and the menu opens beside its button.

By hand: scroll down until the yellow bar has just gone off the top of the window and the blue Open menu button is visible, then click it.