Skip to content

Commit caca47e

Browse files
committed
fix: fix flicker on action-bar
1 parent 63a272e commit caca47e

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

frontend/src/routes/items/+page.svelte

+9-6
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,14 @@
6565
6666
let fixActionbar = true;
6767
onMount(() => {
68-
const observer = new IntersectionObserver((entries) => {
69-
entries.forEach((entry) => {
70-
fixActionbar = !entry.isIntersecting;
71-
});
72-
});
68+
const observer = new IntersectionObserver(
69+
(entries) => {
70+
entries.forEach((entry) => {
71+
fixActionbar = !entry.isIntersecting;
72+
});
73+
},
74+
{ threshold: 1 }
75+
);
7376
observer.observe(document.querySelector('#actionbar-anchor')!);
7477
});
7578
</script>
@@ -90,6 +93,6 @@
9093
<Separator class="my-4" />
9194
<p class="text-muted-foreground text-center mb-4">End of Content</p>
9295

93-
<ItemActionFloating bind:data bind:fixed={fixActionbar} />
9496
<div id="actionbar-anchor"></div>
97+
<ItemActionFloating {data} fixed={fixActionbar} />
9598
</div>

0 commit comments

Comments
 (0)