Skip to content

Commit

Permalink
nested scrollend
Browse files Browse the repository at this point in the history
  • Loading branch information
clementroche committed Dec 27, 2024
1 parent debe04c commit 2e1e321
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/lenis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -676,8 +676,8 @@ export class Lenis {

this.options.wrapper.dispatchEvent(
new CustomEvent('scrollend', {
bubbles: true,
cancelable: false,
bubbles: this.options.wrapper === window,
// cancelable: false,
detail: {
lenisScrollEnd: true,
},
Expand Down
6 changes: 5 additions & 1 deletion playground/core/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ document
// })

window.addEventListener('scrollend', (e) => {
console.log('scrollend', e)
console.log('window scrollend', e)
})

document.querySelector('#nested')?.addEventListener('scrollend', (e) => {
console.log('nested scrollend', e)
})

window.addEventListener('hashchange', () => {
Expand Down

0 comments on commit 2e1e321

Please sign in to comment.