Skip to content

Commit

Permalink
Update notification.js
Browse files Browse the repository at this point in the history
  • Loading branch information
danharrin committed Jan 18, 2025
1 parent fb95285 commit 1f8c869
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ export default (Alpine) => {
return
}

// Calling `el.getBoundingClientRect()` from outside `requestAnimationFrame()` can
// occasionally cause the page to scroll to the top.
requestAnimationFrame(() => {
const getTop = () => this.$el.getBoundingClientRect().top
const oldTop = getTop()
Expand Down

0 comments on commit 1f8c869

Please sign in to comment.