Skip to content

Commit

Permalink
restartWebflow: Fixed slider modules restart to ensure they are alw…
Browse files Browse the repository at this point in the history
…ays redrawed.
  • Loading branch information
alexiglesias93 committed Dec 8, 2022
1 parent 06aa7fb commit d4b3fae
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/pink-berries-switch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@finsweet/ts-utils': patch
---

`restartWebflow`: Fixed slider modules restart to ensure they are always redrawed.
9 changes: 8 additions & 1 deletion src/webflow/restartWebflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,14 @@ export const restartWebflow = async (modules?: WebflowModule[]): Promise<unknown
if (modules?.includes('lightbox')) Webflow.require('lightbox')?.ready();

// Slider
if (modules?.includes('slider')) Webflow.require('slider')?.redraw();
if (modules?.includes('slider')) {
const slider = Webflow.require('slider');

if (slider) {
slider.redraw();
slider.ready();
}
}

// Tabs
if (modules?.includes('tabs')) Webflow.require('tabs')?.redraw();
Expand Down

0 comments on commit d4b3fae

Please sign in to comment.