Skip to content

Commit

Permalink
fix(cdk:scroll): scrollTop error caused by miscalculation (#1120)
Browse files Browse the repository at this point in the history
  • Loading branch information
sallerli1 committed Sep 7, 2022
1 parent 96aa237 commit f16c97b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function useScrollPlacement(
): ScrollPlacementContext {
const maxScrollHeight = computed(() => {
const height = scrollHeight.value
return height > 0 ? height - props.height : NaN
return height > 0 ? Math.max(height - props.height, 0) : NaN
})

const scrolledTop = computed(() => scrollTop.value <= 0)
Expand Down

0 comments on commit f16c97b

Please sign in to comment.