Defenestrate
Defenestrate

Reputation: 463

React-Perfect-Scrollbar and Material UI

I'm trying (without success) to get react-perfect-scrollbar working in my material-ui app.

I've extracted a simple version to https://codesandbox.io/s/agitated-resonance-4yxzo

The aim is for only the 'content' section (the bit with the lorem-ipsum!) to be scrollable and for the scrollbar to be only visible within this content area.

Any ideas?

Cheers!

Upvotes: 1

Views: 3175

Answers (1)

Zach dev
Zach dev

Reputation: 1620

There is 2 changes need it to make it works

  1. Import the css of PerfectScroll

    import "react-perfect-scrollbar/dist/css/styles.css";
    
  2. Create a wrapper with some height, otherwise gonna grow as content need it

here is a fork from your code: https://codesandbox.io/s/quirky-matsumoto-pvcn1

Upvotes: 2

Related Questions