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-now': scrollingNowTimer,
scrolling: scrollingTimer, scrolling: scrollingTimer,
}" }"
@mousemove="mousemove" @mousemove.passive="mousemove"
@touchmove="touchmove" @touchmove.passive="touchmove"
@mouseleave="mouseleave" @mouseleave.passive="mouseleave"
@mousedown="mousedown" @mousedown.passive="mousedown"
> >
<span <span
class="cursor st" class="cursor st"
@ -23,7 +23,7 @@
<span <span
class="cursor hv" class="cursor hv"
:style="{ transform: `translateY(${hoverCursorY}px)` }" :style="{ transform: `translateY(${hoverCursorY}px)` }"
@touchmove="touchmove" @touchmove.passive="touchmove"
> >
<div class="text">{{ hoverCursorText }}</div> <div class="text">{{ hoverCursorText }}</div>
<div class="icon"><ScrollIcon :size="22" /></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( (this.$refs.recycler as any).$el.addEventListener(
"scroll", "scroll",
this.scrollPositionChange, this.scrollPositionChange,
false { passive: true }
); );
// Get data // Get data

View File

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

View File

@ -93,7 +93,9 @@ export default class OnThisDay extends Mixins(GlobalMixin) {
mounted() { mounted() {
const inner = this.$refs.inner as HTMLElement; 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(); this.refresh();
} }