Skip to content

Commit

Permalink
feat: handle selector differently on first load
Browse files Browse the repository at this point in the history
  • Loading branch information
flornkm committed Dec 23, 2023
1 parent 63e11db commit b5d8dba
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions interface/components/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ export default function Navigation() {
}

useLayoutEffect(() => {
// On first render, wait for the selector to be rendered
if (selectorPosition.x === 0 && selectorPosition.width === 0) {
setTimeout(() => {
handleSelector()
}, 100)
}

requestAnimationFrame(() => {
handleSelector()
})
Expand Down

1 comment on commit b5d8dba

@vercel
Copy link

@vercel vercel bot commented on b5d8dba Dec 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.