Make listeners passive

pull/162/head
Varun Patil 2022-10-29 17:17:34 -07:00
parent af5e3ef105
commit 32bc48418f
4 changed files with 13 additions and 11 deletions

View File

@ -8,10 +8,10 @@
'scrolling-now': scrollingNowTimer,
scrolling: scrollingTimer,
}"
@mousemove="mousemove"
@touchmove="touchmove"
@mouseleave="mouseleave"
@mousedown="mousedown"
@mousemove.passive="mousemove"
@touchmove.passive="touchmove"
@mouseleave.passive="mouseleave"
@mousedown.passive="mousedown"
>
<span
class="cursor st"
@ -23,7 +23,7 @@
<span
class="cursor hv"
:style="{ transform: `translateY(${hoverCursorY}px)` }"
@touchmove="touchmove"
@touchmove.passive="touchmove"
>
<div class="text">{{ hoverCursorText }}</div>
<div class="icon"><ScrollIcon :size="22" /></div>

View File

@ -271,7 +271,7 @@ export default class Timeline extends Mixins(GlobalMixin, UserConfig) {
(this.$refs.recycler as any).$el.addEventListener(
"scroll",
this.scrollPositionChange,
false
{ passive: true }
);
// Get data

View File

@ -22,10 +22,10 @@
class="img-outer fill-block"
@click="emitClick"
@contextmenu="contextmenu"
@touchstart="touchstart"
@touchmove="touchend"
@touchend="touchend"
@touchcancel="touchend"
@touchstart.passive="touchstart"
@touchmove.passive="touchend"
@touchend.passive="touchend"
@touchcancel.passive="touchend"
>
<img
ref="img"

View File

@ -93,7 +93,9 @@ export default class OnThisDay extends Mixins(GlobalMixin) {
mounted() {
const inner = this.$refs.inner as HTMLElement;
inner.addEventListener("scroll", this.onScroll.bind(this));
inner.addEventListener("scroll", this.onScroll.bind(this), {
passive: true,
});
this.refresh();
}