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

fix scroll event in react 17 #90

Merged
merged 1 commit into from
Jul 24, 2021

Conversation

ajnetterfield
Copy link
Contributor

When using the legacy scroll event as a fallback, the horizontal scroll event originates at the table element (.rt-table) and in React 16 and lower it bubbles up to the root element. However, React 17 no longer bubbles the scroll event (facebook/react#19464), preventing the scroll handler from running on the root element via getProps.

I have attempted to address this issue in React 17 by handling the scroll event on the table element directly via getTableProps. I have also ensured the calculatePos callback is only called on the table element itself (i.e. event.currentTarget === event.target) to maintain support for React 15 and 16.

@GuillaumeJasmin GuillaumeJasmin merged commit ef60762 into GuillaumeJasmin:master Jul 24, 2021
@GuillaumeJasmin
Copy link
Owner

Thanks for your contribution ! Sorry for the delay.
It's on v2.3.4

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

Successfully merging this pull request may close these issues.

2 participants