goldenyz / react-perfect-scrollbar

A react wrapper for perfect-scrollbar
MIT License
480 stars 91 forks source link

How to enable refresh on swipe down on mobile? #132

Open piotrkraszewski opened 3 years ago

piotrkraszewski commented 3 years ago

How to enable refresh on swipe down gesture on mobile when you replace default scrollbar with perfect scrollbar?

I am wrapping all my components in scrollbar but then refresh on mobile doesn't work. Right now I used a solution from this link that disables perfect-scrollbar on mobile and I am using it only on pc: https://github.com/goldenyz/react-perfect-scrollbar/issues/101

import ScrollBar from 'react-perfect-scrollbar'
import { isMobile } from "react-device-detect";
import './ScroolbarStyle.scss'

export default function AppScrollbar (props) {
  return (
    isMobile ? (
      <div className="overflow-y-auto">
        {props.children}
      </div>
    ) : (
      <ScrollBar className='AppScroolbar'>
        {props.children}
      </ScrollBar>
  ))
.AppScroolbar{
  position: absolute;
  width: 100%;
  height: 100%;
}