If the keyboard focus is out of bounds (as a result of e.g. switching from a panel with plenty of focusable items to a panel with very few items), then reset to the focus to the last of the focusable items
If the keyboard focus is out of bounds (as a result of e.g. switching from a panel with plenty of focusable items to a panel with very few items), then reset to the focus to the last of the focusable items

marcuswestin/Focus