Dialog: Search the correct document for focus trapping. Fixes #9439 - Dialog: Context is not respected for modals.