Custom row renderer height causes scrolling to jump on chrome
-
Have you already searched for similar issues? Please help us out and double-check first! Yes, this is similar to #730 which was closed without really being fixed
-
Also, please don't be that person who deletes this template. It's here for a reason.
-
Thanks!
Which version of React JS are you using?
✅ Officially supported ✅
- [ ] v15.4.x
⚠️ Not officially supported, expect warnings ⚠️
- [ ] v15.5.x
- [ ] v15.6.x
☣️ Not officially supported, expect warnings and errors ☣️
- [x] v16.x.x (16.8)
Which browser are you using?
✅ Officially supported ✅
- [ ] IE 9 / IE 10 / IE 11
- [ ] Edge
- [x] Chrome
⚠️ Not officially supported, but "should work" ⚠️
- [x ] Firefox
- [ ] Safari
I'm submitting a ...
- [x] 🐛 Bug Report
- [ ] 💡 Feature Request
👋 Need general support? Not sure about how to use React itself, or how to get started with the Grid? Please do not submit support request here. Instead see
https://github.com/adazzle/react-data-grid/blob/master/CONTRIBUTING.md
Issue Details
Please include:
- What the current behavior is
- What the desired behvaior is
- (If Bug) Steps to reproduce the issue
- (If Feature) The motivation / use case for the feature
We especially love screenshots / videos of problems, and remember
The Best Issue Is A Pull Request™
When you create a RowRenderer which changes the height of the row, then the scrolling becomes very jumpy. You can see it in this sandbox: https://codesandbox.io/embed/rdg-custom-row-renderer-with-base-row-wbip0 This is just a fork of render-base-row example with the custom row renderer changed to be like this:
const RowRenderer = ({ renderBaseRow, ...props }) => {
const height = props.idx % 2 ? "40px" : "80px";
return <div>{renderBaseRow({ ...props, height })}</div>;
};
The behaviour is worst on chrome... there it becomes pretty impossible to use the mouse scroll wheel to scroll, and it jumps all over the place. It's better on firefox, but there can still be some issues, especially when you get down to the bottom of the page...
This issue is similar to #730, but since that was closed without being fixed I'm re-opening this one.
You can also see this bug in the example of how to use Custom row renderer. https://adazzle.github.io/react-data-grid/docs/examples/row-renderer
react-data-grid does not support custom row heights and setting different height using row renderer can cause issues. Also we recommend migrating to v7 canary
https://github.com/adazzle/react-data-grid/blob/canary/CHANGELOG.md https://adazzle.github.io/react-data-grid/canary/?path=/story/demos--common-features