diff --git a/packages/notifications/resources/js/components/notification.js b/packages/notifications/resources/js/components/notification.js index ad47d40fd0..5c88557e2c 100644 --- a/packages/notifications/resources/js/components/notification.js +++ b/packages/notifications/resources/js/components/notification.js @@ -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()