codingfishman / react-scroll-pagination

MIT License
7 stars 6 forks source link

Fixed can't work if this component is used in sub container. #4

Open malikid opened 7 years ago

malikid commented 7 years ago

Related to #2 . What I added are two optional attributes for users deciding to use custom "window" and "document" (when used in a container) or the default ones.

YumHax commented 7 years ago

Hey! Thank you for improving this component! Can you please provide us with further documentation on how to apply the scrolling behaviour to a subcontainer?

I tried this :

<Container id="myContainerName">
      <table id="myDataTableName">
             ...
      </table> 
     <ReactScrollPagination documentElement="#myDataTableName" windowElement="#myContainerName" fetchFunc ={...} />
</Container>

but could not make it work :(

EDIT : finally works as intended ! My imports did not point to your version of the component but to the master one. Thank you for the good work ! :)

malikid commented 7 years ago

Glad it helps! I should add the usage of the attributes in README.

codingfishman commented 7 years ago

@malikid It would be a great help if you can update the demo :), the original one is here: https://jsfiddle.net/nickday/dat4qpam/