This seems to differ from the button-focusing logic in the `"shown"` handler.  Should be hoisted out into a shared helper function?