I'm trying to develop timeline component. This is stripped version of it to demonstrate issue:
https://jsfiddle.net/mauron85/5vverasn/
It should render 48 hour intervals between two dates (1/30/2007 - 1/31/2007) in table header and courier routes (rendered as cascade of squares), courier working hours and striped background in the table body.
My problem is that scrolling is only possible up to last courier route (3PM). There are no other routes, but I would like to enable scrolling to very last hour interval (11PM)
It's working when there is only one component in table body, but it's not when there more of them. In this case there is only stripe background.
Pseudo code:
this is working perfectly:
<ScrollSync>
<AutoSizer disableHeight>
<Grid className={styles.HeaderGrid} /> {/* hour intervals */}
<div className={styles.Body}>
<Grid /> {/* table striped background */}
</div>
</AutoSizer>
</ScrollSync>
but scrolling is limited when multiple children in AutoSizer:
<ScrollSync>
<AutoSizer disableHeight>
<div>
<Grid className={styles.HeaderGrid} /> {/* hour intervals */}
<div className={styles.Body}>
<Grid /> {/* table striped background */}
<Collection/> {/* courier routes has to be collection */}
<Collection/> {/* courier working hours has to be collection */}
</div>
</div>
</AutoSizer>
</ScrollSync>
Comment out block: {/* when following commented scrolling works as expected */} in sample project to get expected scrolling behavior.
Not 100% sure where is the catch, but I believe it's because every child component Grid, Collection ... has its own ReactVirtualized__Collection__innerScrollContainer, which has different width and only very last in DOM tree is actually scrollable/visible. Playing with z-index of components confirms this.