Home > widget-integration > InstantSearchController > cleanupScrollLock

InstantSearchController.cleanupScrollLock() method

Release an attribute-based theme scroll lock left behind when ISW closed the theme's search dialog.

Horizon 2025+ locks scroll with a scroll-lock attribute on <html> and releases it only from dialog-component.closeDialog(). Full-width ISW closes that dialog to win the top layer, so the lock has to be released here — otherwise the storefront stays unscrollable after ISW closes (BOOST-21862). Older Horizon versions lock via inline body styles instead, which handles.

Delegates the guard logic to InstantSearchSelectors.releaseThemeScrollLock(), which leaves the lock alone when another drawer or modal still owns it.

Signature:

protected cleanupScrollLock(): void;

Returns:

void

Example

window.boostWidgetIntegration.extend('InstantSearchController', (InstantSearchController) => {
  return class CustomController extends InstantSearchController {
    protected cleanupScrollLock() {
      super.cleanupScrollLock();
      // Theme also locks scroll with a class on a custom wrapper
      document.querySelector('.page-wrapper')?.classList.remove('is-locked');
    }
  };
});