chore(web): passive events (#19179)

This commit is contained in:
Mert 2025-06-16 11:03:23 -04:00 committed by GitHub
parent 3d0c851636
commit 5fc448bc97
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 68 additions and 58 deletions

View file

@ -105,9 +105,9 @@
}
observer.observe(input);
const scrollableAncestor = input?.closest('.overflow-y-auto, .overflow-y-scroll');
scrollableAncestor?.addEventListener('scroll', onPositionChange);
window.visualViewport?.addEventListener('resize', onPositionChange);
window.visualViewport?.addEventListener('scroll', onPositionChange);
scrollableAncestor?.addEventListener('scroll', onPositionChange, { passive: true });
window.visualViewport?.addEventListener('resize', onPositionChange, { passive: true });
window.visualViewport?.addEventListener('scroll', onPositionChange, { passive: true });
return () => {
observer.disconnect();