Skip to content

Commit

Permalink
Clear pixel tolerance during SSR
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjerleke committed Feb 3, 2025
1 parent 4ae9e0c commit d18c917
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/embla-carousel/src/components/Engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export function Engine(
} = options

// Measurements
const pixelTolerance = 2
const pixelTolerance = isSsr ? 0 : 2
const containerRect = nodeHandler.getRect(container)
const slideRects = slides.map(nodeHandler.getRect)
const axis = Axis(scrollAxis, direction)
Expand Down
2 changes: 1 addition & 1 deletion packages/embla-carousel/src/components/ScrollContain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function ScrollContain(
const snapsContained = measureContained()

function usePixelTolerance(bound: number, snap: number): boolean {
return deltaAbs(bound, snap) <= 1
return pixelTolerance ? deltaAbs(bound, snap) <= 1 : false
}

function findScrollContainLimit(): LimitType {
Expand Down

0 comments on commit d18c917

Please # to comment.