-
Notifications
You must be signed in to change notification settings - Fork 374
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
Scroll multiplier doesn't work with float numbers and looks laggy #381
Comments
under "laggy" I mean that when you scroll with a mouse wheel or trackpad, the scroll always jump to the next/previous row |
So we need to implement a different scrolling mechanism. We will most likely add some setting that will change the default scroll behavior and will work based on pixels and not rows. We will try to implement it as soon as possible and will leave info here when we are done. |
New functionality has been added in version const config = {
/* ... */
scroll: {
horizontal: {
multiplier: 0.3,
precise: true,
byPixels: true,
},
vertical: {
multiplier: 0.3,
precise: true,
byPixels: true,
},
},
/* ... */
}; But there is a little catch. If you use Example const configScroll = this.state.get('config.scroll.horizontal');
const scrollLeft = this.api.getScrollLeft();
if (configScroll.byPixels) {
this.api.setScrollLeft(scrollLeft.absolutePosPx + 1); // offset + 1 pixel
} else {
this.api.setScrollLeft(scrollLeft.dataIndex + 1); // offset + one date
} |
@neuronetio , thank you very much for your quick reaction! |
Works like a charm, thanks |
Describe the bug
Scrolling config doesn't work with float numbers and looks laggy with a mouse wheel or trackpad (even with
multiplier: 1
it's not smooth).Code
For example we can check: https://github.com/neuronetio/gantt-schedule-timeline-calendar/blob/master/examples/complex-1/index.js with this scroll config:
Scrolling works smoothly with the scrollbars (grabbing them and move) , but laggy with a mouse wheel or trackpad.
gantt-schedule-timeline-calendar version
3.33.16
The text was updated successfully, but these errors were encountered: