malte-wessel / react-custom-scrollbars

React scrollbars component
http://malte-wessel.github.io/react-custom-scrollbars/
MIT License
3.2k stars 577 forks source link

Does not scroll down progress bar when selecting sections not visible in bar #367

Open dhyanaswain opened 3 years ago

dhyanaswain commented 3 years ago

Scroll bar does not scroll with user, while scrolling in main screen, I have 2 scroll bar now, one is the native scrollbar and other one is the scroll bar i have added to the component

I have 14 item in the list A-N.

The scrollBar component height is same as the windows screen hight and fixed to top, when i scroll each item are getting highlighted but the scroll is not happening , to see the item which is not visible(J-N) right now in the screen and highlighted i need to scroll in the component itself,

if any one know how i can mount the windows scroll to the custom scroll please let me know

My code:

<div className="col-12 form-progress pt-3 mb-1">
   <Scrollbars className='form-progress__scrollableContent' key={`${props.id}-scrollableContent`}>
      {progressItems.map((itemProps: ProgressBarItemProps, idx: number) => (
          <ProgressBarItem
                 key={`key-${itemProps.name}`}
                 index={idx}
                 clickHandler={handleProgressSidebarClick}
                 name={itemProps.name}
                 status={itemProps.status}
                 arialabelScreenReader={itemProps.arialabelScreenReader}
         />
      ))}
  </Scrollbars>
</div>

what currently happening: 032b5bab-06aa-4d0e-bc3a-20b9752aeda8

Expected: 97538b6f-3abf-4aa7-b976-a2c69866a7bd