Home > widget-integration > InstantSearchController > activateFocusTrap

InstantSearchController.activateFocusTrap() method

Activate focus trap for full-width overlay mode.

Prevents Tab / Shift+Tab from leaving the overlay, keeping keyboard focus cycling through interactive elements inside the ISW wrapper.

Stores the handler in focusTrapHandler so it can be removed by deactivateFocusTrap() without leaking event listeners.

**WCAG**: SC 2.1.2 No Keyboard Trap — trap is intentional UX (modal-like overlay) and Escape always closes it, satisfying the escape-mechanism requirement.

Signature:

protected activateFocusTrap(): void;

Returns:

void