Skip to content

Commit

Permalink
fix: fix flicker on action-bar
Browse files Browse the repository at this point in the history
  • Loading branch information
0x2E committed May 24, 2024
1 parent 63a272e commit caca47e
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions frontend/src/routes/items/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,14 @@
let fixActionbar = true;
onMount(() => {
const observer = new IntersectionObserver((entries) => {
entries.forEach((entry) => {
fixActionbar = !entry.isIntersecting;
});
});
const observer = new IntersectionObserver(
(entries) => {
entries.forEach((entry) => {
fixActionbar = !entry.isIntersecting;
});
},
{ threshold: 1 }
);
observer.observe(document.querySelector('#actionbar-anchor')!);
});
</script>
Expand All @@ -90,6 +93,6 @@
<Separator class="my-4" />
<p class="text-muted-foreground text-center mb-4">End of Content</p>

<ItemActionFloating bind:data bind:fixed={fixActionbar} />
<div id="actionbar-anchor"></div>
<ItemActionFloating {data} fixed={fixActionbar} />
</div>

0 comments on commit caca47e

Please sign in to comment.