fisshy / react-scroll

React scroll component
https://github.com/fisshy/react-scroll/blob/master/README.md
MIT License
4.35k stars 436 forks source link

scroller.scrollTo() is not working at all #568

Open ItZmEkAtHiR opened 11 months ago

ItZmEkAtHiR commented 11 months ago

@fisshy I've tried smooth scrolling using element and scroller but is not scrolling

PFB for the codesandbox link

https://codesandbox.io/s/serene-david-t6pf6v

fisshy commented 11 months ago

Hi, you have to specify "overflow:scroll"

.App {
  font-family: sans-serif;
  text-align: center;
  height: 95vh;
  overflow: scroll;
}
section {
  width: 90vw;
  height: 500px;
  display: flex;
  justify-content: center;
  /* scroll-snap-align: start; */
  align-items: center;
  background-color: darkcyan;
  border: 10px solid;
  border-radius: 10px;
}
body {
  /* overflow: hidden; */
}