Home > widget-integration > StickyService
StickyService class
Signature:
export declare class StickyService
Constructors
|
Constructor |
Modifiers |
Description |
|---|---|---|
|
Constructs a new instance of the |
Properties
|
Property |
Modifiers |
Type |
Description |
|---|---|---|---|
|
number | |||
|
number[] | |||
|
HTMLElement | null | |||
|
HTMLElement | null | |||
|
number | |||
|
HTMLElement | null | |||
|
MutationObserver | null | |||
|
NormalizedBoostStickyOptions | null | |||
|
StickyOriginalStyles | null | |||
|
string | |||
|
|
Signal<StickyServiceState> | ||
|
MutationObserver | null | |||
|
number | |||
|
"up" | "down" | "none" |
Methods
|
Method |
Modifiers |
Description |
|---|---|---|
|
Registers a window listener that will be removed during cleanup. | ||
|
Applies sticky positioning, dimensions, top offset, and stacking styles to the current target. | ||
|
Starts basic sticky behavior. | ||
|
Starts bounded sticky behavior. | ||
|
|
Captures hidden Shopify headers before opening mobile vertical filter panels. | |
|
Removes listeners, observers, timers, and restores original inline styles. | ||
|
|
Clears cleanup-bound timeouts registered by wrapper factory methods. | |
|
|
Clears captured hidden-header state, observer, and timers. | |
|
Clears fullscreen mobile filter styles left by sticky mobile overlay behavior. | ||
|
|
Returns true when CSS creates a stacking context that can trap sticky overlays. | |
|
|
Temporarily hides a panel until toolbar/header positioning settles. | |
|
elevateAncestorStackingContexts(element, zIndex, originalStyles) |
|
Promotes ancestors so sticky toolbar UI can render above theme stacking contexts. |
|
elevateElementAndAncestorsStackingContexts(element, zIndex, originalStyles) |
|
Promotes an element and its stacking-context ancestors. |
|
elevateElementStackingContext(element, zIndex, originalStyles, background) |
|
Promotes a single element and stores its original stacking styles. |
|
elevateVisibleHeaderStackingContexts(zIndex, originalStyles, background) |
|
Promotes visible fixed/sticky theme headers while a toolbar is pinned. |
|
|
Returns z-index used when mobile filter overlay must cover the full viewport. | |
|
|
Returns Shopify headers hidden by the current theme scroll behavior. | |
|
|
Returns selectors and event name used by desktop horizontal toolbar sticky behavior. Override this when a theme wraps the horizontal filter or uses different action/toggle markup. | |
|
|
Returns delayed sync timings for horizontal toolbar sticky interactions. Override this when a theme animation takes longer or shorter than Boost defaults. | |
|
|
Finds the active theme drawer z-index so Boost sticky UI can stay below open drawers. | |
|
|
Reads a visible, non-transparent background from a theme element. | |
|
|
Returns z-index used for headers temporarily pinned above fullscreen mobile filters. | |
|
|
Returns z-index used for toolbar ancestors promoted during sticky positioning. | |
|
|
Returns the fallback toolbar background used when no explicit option is provided. | |
|
|
Builds sticky background styles for toolbar-based sticky layouts. | |
|
|
Resolves toolbar background from the configured toolbar selector. | |
|
Computes the top offset from configured selectors, elements, and fallback theme headers. | ||
|
Returns the visible bottom edge used as a top offset source. | ||
|
|
Finds the highest visible fixed or sticky theme header z-index. | |
|
|
Returns the current scroll position. Override for shops with custom scroll containers. | |
|
Handles DOM mutations that may require reapplying sticky dimensions or offsets. | ||
|
|
Checks whether an element is visible inside the current viewport. | |
|
|
Detects Dawn-style header reveal animation that can overlap the sticky filter panel. | |
|
|
Detects visible theme search modals that should take stacking priority over Boost toolbar UI. | |
|
|
Detects whether a CSS background value should be treated as transparent. | |
|
Locks sticky width from target or child layout width. | ||
|
Creates a basic sticky filter instance. | ||
|
Creates a bounded vertical filter sticky instance constrained by collection/product layout bounds. | ||
|
Creates desktop horizontal filter sticky behavior for non-expand layouts. | ||
|
Creates desktop horizontal expand toolbar sticky behavior. | ||
|
Creates mobile off-canvas toolbar sticky behavior with fullscreen overlay alignment. | ||
|
Creates mobile collapse-expand vertical filter sticky behavior. | ||
|
Creates a sticky toolbar instance used by mobile and off-canvas filter modes. | ||
|
Creates desktop vertical expand toolbar sticky behavior with a bounded filter panel. | ||
|
Normalizes partial sticky options with defaults and safe selector/number handling. | ||
|
Starts document mutation observation for sticky target/layout changes. | ||
|
Observes theme search modal state so Boost toolbar stacking stays below modal UI. | ||
|
Returns the first matching element from a selector list. | ||
|
Re-resolves elements and reapplies sticky styles. | ||
|
|
Registers a timeout that should be canceled when the wrapped sticky instance cleans up. | |
|
Resolves the sticky boundary for bounded vertical sticky behavior. | ||
|
Resolves the sticky target, layout container, fallback boundary, and original inline styles. | ||
|
|
Resolves the sticky element background, preferring explicit options and original theme color. | |
|
|
Restores inline styles saved before ancestor/header stacking promotion. | |
|
|
Restores any hidden headers captured when the toolbar opened. | |
|
|
Restores hidden Shopify header classes captured before toolbar open. | |
|
revealHiddenHeaderWhenToolbarPinned(toolbar, allowReveal, topOffset) |
|
Reveals Shopify hidden headers when a sticky toolbar is pinned and user scrolls upward. |
|
Schedules a short delayed stacking sync for theme modal/drawer transitions. | ||
|
|
Shows a panel hidden while toolbar/header positioning settles. | |
|
Starts sticky behavior in basic or bounded mode. | ||
|
Synchronizes off-canvas panel top/height/z-index against sticky toolbar position. | ||
|
syncPinnedHeaderStackingContexts(toolbar, topOffset, zIndex, originalStyles, background) |
|
Synchronizes header stacking while the toolbar is fixed or sticky near the top offset. |
|
Re-resolves sticky DOM elements after filter markup changes. | ||
|
Synchronizes toolbar stacking with open theme search modals or drawers. | ||
|
syncToolbarZIndexWithOpenThemeDrawer(toolbar, defaultZIndex) |
|
Updates toolbar z-index to avoid covering open theme drawers, search modals, or headers. |
|
|
Tracks scroll direction for header reveal behavior during sticky toolbar interactions. |