We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1c7357e commit 5cbe8b0Copy full SHA for 5cbe8b0
src/components/VueScrollProgressBar.vue
@@ -64,7 +64,21 @@ export default {
64
},
65
66
mounted () {
67
- window.addEventListener('scroll', this.handleScroll)
+ let passiveIfSupported = false
68
+
69
+ try {
70
+ const options = {
71
+ get passive () {
72
+ passiveIfSupported = { passive: true }
73
+ return false
74
+ }
75
76
77
+ window.addEventListener('test', null, options)
78
+ window.removeEventListener('test', null, options)
79
+ } catch (error) {}
80
81
+ window.addEventListener('scroll', this.handleScroll, passiveIfSupported)
82
window.dispatchEvent(new Event('scroll'))
83
84
0 commit comments