Make event listneres passive.

This commit is contained in:
Richard Lewis 2018-07-13 20:58:01 +03:00 committed by Pavel Djundik
parent c9f5e06ee4
commit f4b4cfdee2

View file

@ -136,8 +136,8 @@ export default {
}, },
mounted() { mounted() {
this.scrolledToBottom = true; this.scrolledToBottom = true;
window.addEventListener("resize", debounce(this.handleResize, 50)); window.addEventListener("resize", debounce(this.handleResize, 50), {passive: true});
this.$refs.chat.addEventListener("scroll", debounce(this.handleScroll, 50)); this.$refs.chat.addEventListener("scroll", debounce(this.handleScroll, 50), {passive: true});
this.$nextTick(() => { this.$nextTick(() => {
if (this.historyObserver) { if (this.historyObserver) {
this.historyObserver.observe(this.$refs.loadMoreButton); this.historyObserver.observe(this.$refs.loadMoreButton);