Skip to content

Commit

Permalink
Merge pull request #17 from finsweet/slider-restart-fix
Browse files Browse the repository at this point in the history
`restartWebflow`: Fixed slider modules restart to ensure they are always redrawed
  • Loading branch information
alexiglesias93 authored Dec 8, 2022
2 parents 06aa7fb + d4b3fae commit b803816
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 b803816

Please sign in to comment.