hammerjs / hammer.js

A javascript library for multi-touch gestures :// You can touch this
http://hammerjs.github.io
MIT License
24.09k stars 2.63k forks source link

Is there a way to implement elastic/rubber-band scrolling with Hammerjs? #1270

Open purvishah165 opened 3 years ago

purvishah165 commented 3 years ago

I am using Hammerjs with React and currently I have set up hammerjs so that I can pan left right or up down. I want to implement rubber band scrolling effect when am the end of the scroll area but not sure how can I achieve this effect. Any Ideas? ` useEffect(() => { if (state.isPanning === false) { if (isScrollAtEnd()) { //TODO add bounce on scroll end } } }, [isScrollAtEnd, state.isPanning]);