Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

what is best way to prevent whole page scrolling when table is scrolling up? #419

Closed
datavisorfrankhe opened this issue Mar 27, 2019 · 6 comments

Comments

@datavisorfrankhe
Copy link

I found that when table is scrolling up, the whole page containing the table keeps scrolling up also. Can I ask what is the best way to prevent out div wrapper from scrolling up when the table is scrolling, even if it has already scrolled to the end?

I tried the onScrollStartEvent, I want to have the native event, and then use event.preventPropotation, but I can not get the native scrolling event from this event.

Any ideal will be helpful.

Thanks

Your Environment

  • Version used:
    "react": "15.3.2",
    "fixed-data-table-2": "^0.8.13",

  • Browser Name and version:

  • Operating System and version (desktop or mobile):

  • Link to your project:

@wcjordan
Copy link
Member

I suspect this is caused by #407. Feel free to try out the proposed changes to fix the issue mentioned there and let me know how it goes.

@pradeepnschrodinger
Copy link
Collaborator

@datavisorfrankhe, I think this might be due to our onWheel handler not calling preventDefault if there's no apparent scrolling. Basically this call is skipped if there's no scroll to be done, which happens if you scroll up when the table is already at top position.

@wcjordan , we'll put a quick PR for this?

@wcjordan
Copy link
Member

wcjordan commented Apr 3, 2019

Hmm I actually think that would be expected behavior. If you scroll to the top of the grid and continue to scroll up, it should scroll the page up. For an example of what I mean, play around with the scrollable grid content here: https://www.ag-grid.com/example-gallery/#example-auto-height-full-width

@datavisorfrankhe
Copy link
Author

datavisorfrankhe commented Apr 3, 2019 via email

@wcjordan
Copy link
Member

wcjordan commented Apr 3, 2019

A flag seems like a reasonable approach.

@pradeepnschrodinger
Copy link
Collaborator

@datavisorfrankhe, issue fixed with release v1.0.0-beta.16.
You need to pass the flag stopScrollDefaultHandling with true so that the page is never scrolled up while scrolling in the table.

I'll close the issue for now, but feel free to reopen if you face any issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants