mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
chore(web): passive events (#19179)
This commit is contained in:
parent
3d0c851636
commit
5fc448bc97
12 changed files with 68 additions and 58 deletions
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@
|
|||
|
||||
onMount(() => {
|
||||
if (browser) {
|
||||
document.addEventListener('scroll', onScroll);
|
||||
document.addEventListener('scroll', onScroll, { passive: true });
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -357,18 +357,18 @@
|
|||
};
|
||||
/* eslint-enable tscompat/tscompat */
|
||||
onMount(() => {
|
||||
document.addEventListener('touchmove', onTouchMove, true);
|
||||
document.addEventListener('touchmove', onTouchMove, { capture: true, passive: true });
|
||||
return () => {
|
||||
document.removeEventListener('touchmove', onTouchMove);
|
||||
document.removeEventListener('touchmove', onTouchMove, true);
|
||||
};
|
||||
});
|
||||
|
||||
onMount(() => {
|
||||
document.addEventListener('touchstart', onTouchStart, true);
|
||||
document.addEventListener('touchend', onTouchEnd, true);
|
||||
document.addEventListener('touchstart', onTouchStart, { capture: true, passive: true });
|
||||
document.addEventListener('touchend', onTouchEnd, { capture: true, passive: true });
|
||||
return () => {
|
||||
document.addEventListener('touchstart', onTouchStart, true);
|
||||
document.addEventListener('touchend', onTouchEnd, true);
|
||||
document.removeEventListener('touchstart', onTouchStart, true);
|
||||
document.removeEventListener('touchend', onTouchEnd, true);
|
||||
};
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue