voxtobox/vue-scroll-stop

suggestion of usage

ctf0 opened this issue · 4 comments

ctf0 commented

i believe the package mimics the main behavior of overscroll-behavior

https://caniuse.com/#search=overscroll-behavior
https://developers.google.com/web/updates/2017/11/overscroll-behavior

so if u want maybe we can add those info to the readme or even extract the code to a separate lib so everyone can use it whether is using vue or not 👍

@ctf0 Great idea! Perhaps we can detect whether browser supports overscroll-behavior and use directive only as a polyfill?

ctf0 commented

maybe if u separated the logic into its own lib as a polyfill then yes but in its current state "a lib for vue" i don't think we need the detection.

Grawl commented

if someone find a polyfill for overscroll-behaviour please add link here

Grawl commented

for now, I wrote this:

import VueScrollStop from 'vue-scroll-stop'
if (CSS.supports('overscroll-behavior', 'contain')) {
	console.log('[v-scroll-stop] is disabled, use `overscroll-behavior: contain` instead')
} else {
	console.log('`overscroll-behavior: contain` is not supported, use [v-scroll-stop]')
	Vue.use(VueScrollStop)
}