Repository navigation
Conversation
| ); | ||
|
|
||
| renderFn.mock.calls[0][0].onChildScroll({scrollTop: 200}); | ||
| console.log('here', contentWindow.scrollY) |
There was a problem hiding this comment.
I think you can get rid this log
|
|
||
| export function getDimensions( | ||
| scrollElement: ?Element, | ||
| scrollElement: ?any, |
There was a problem hiding this comment.
We like to avoid any There are valid flow types for html dom elements. https://www.saltycrane.com/flow-type-cheat-sheet/latest/
| export function getPositionOffset(element: Element, container: Element) { | ||
| if (isWindow(container) && document.documentElement) { | ||
| const containerElement = document.documentElement; | ||
| export function getPositionOffset(element: Element, container: any) { |
| */ | ||
| export function getScrollOffset(element: Element) { | ||
| if (isWindow(element) && document.documentElement) { | ||
| export function getScrollOffset(element: any) { |
|
|
||
| function enablePointerEventsAfterDelayCallback() { | ||
| enablePointerEventsIfDisabled(); | ||
| const createEnablePointerEventsAfterDelayCallback = doc => () => { |
There was a problem hiding this comment.
why don't you just pass it as a parameter? and just use .bind?
| export function registerScrollListener( | ||
| component: WindowScroller, | ||
| element: Element, | ||
| element: any, |
| export function unregisterScrollListener( | ||
| component: WindowScroller, | ||
| element: Element, | ||
| element: any, |
|
Sorry for the very long delay in getting back to you about this! I've just finished a large update for version 10 of react-virtualized (#1900): the library has been rewritten in TypeScript, every component is now a function component (React 18+ is required), and the source moved from If you're still interested in this change, I'd welcome a new PR with it rebased onto the |
The WindowScroller should also be functional for use with iframes. Things to note:
anyinstead of the appropriate type because I couldn't find the correct types in the flow docs for documentElement and contentWindow (I apologize for this, I'm not a flow expert by any means).solves issue #1088