facebookarchive / fixed-data-table

A React table component designed to allow presenting thousands of rows of data.
http://facebook.github.io/fixed-data-table/
Other
4.3k stars 553 forks source link

Any suggestions on how to prevent parent page from scrolling up? #438

Open xhe opened 8 years ago

xhe commented 8 years ago

I met a difficulty now, that is when I scroll down to the bottom of the table, the whole page is scrolling up if you continue to scroll down, can anyone help to tell me how you are preventing the parent page from scrolling?

I used this, and it does not work:

jQuery(this.refs.myTable).on('mouseover', function() { document.body.style.overflow = 'hidden'; }); jQuery(this.refs.myTable).on('mouseout', function() { document.body.style.overflow = 'auto'; });

Any good suggestions?

Thanks

nhducit commented 8 years ago

You can try this solution: http://jsfiddle.net/troyalford/4wrxq/4/

xhe commented 8 years ago

No, not working in fixed dataTable. But I used a more simple solution:

_onScrollStartHanlder: function() { document.body.style.overflow = 'hidden'; } _onScrollEndHanlder: function() { document.body.style.overflow = 'auto'; }

I believe biding event on onScrollStart/End is better solution for fixed DataTable

On Mon, Aug 8, 2016 at 1:34 AM, nhducit notifications@github.com wrote:

You can try this solution: http://jsfiddle.net/troyalford/4wrxq/4/

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/facebook/fixed-data-table/issues/438#issuecomment-238174116, or mute the thread https://github.com/notifications/unsubscribe-auth/AAN4c9f6cimSD4t7mWaED0t6WL4WLf-kks5qduoegaJpZM4JdXc0 .