Home > widget-integration > InstantSearchController > detectMobileStyleFromDOM

InstantSearchController.detectMobileStyleFromDOM() method

Detect the mobile ISW style from the rendered DOM. - **style1** (full-width overlay): mobile container contains .boost-sd__search-bar-wrapper--mobile - **style2** (dropdown): no .boost-sd__search-bar-wrapper--mobile present

Override to customise detection for non-standard Liquid template structures.

Signature:

protected detectMobileStyleFromDOM(): "style1" | "style2" | null;

Returns:

"style1" | "style2" | null

'style1', 'style2', or null if the mobile container is not yet in the DOM