We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 581ffc6 commit 0823ff3Copy full SHA for 0823ff3
1 file changed
resources/js/components/StickyTop.vue
@@ -11,10 +11,11 @@
11
const stuck = computed(() => {
12
const style = el.value ? window.getComputedStyle(el.value) : null;
13
const { bottom, top } = selfRect;
14
+ const round = (num:number) => Math.round((num + Number.EPSILON) * 100) / 100;
15
return el.value
16
&& style.position === 'sticky'
17
&& bottom >= 0
- && top <= parseFloat(style.top);
18
+ && round(top) <= round(parseFloat(style.top));
19
});
20
const isOverflowingViewport = ref(false);
21
const { height: innerHeight } = useWindowSize();
0 commit comments