Home > widget-integration > InstantSearchSelectors > getFocusTrapRoot
InstantSearchSelectors.getFocusTrapRoot() method
Resolve the element keyboard focus must stay inside while ISW is open.
Full-width layouts wrap the search bar *and* the results in .boost-sd__search-bar-wrapper — there WRAPPER_NAME is only an id — while dropdown layouts render it as a class. The lookup is scoped to the container of the current device: both containers live in the DOM and the inactive one is display: none.
Scoped via , not the width heuristic: resolving the hidden container yields no focusable elements and the trap goes dead.
Signature:
getFocusTrapRoot(): HTMLElement | null;
Returns:
HTMLElement | null
Focus-trap root, or null when no ISW markup is present