GithubHelp home page GithubHelp logo

Comments (5)

neuronetio avatar neuronetio commented on June 19, 2024 2

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.

from gantt-schedule-timeline-calendar.

JohannesPichlerSTRABAG avatar JohannesPichlerSTRABAG commented on June 19, 2024 1

@neuronetio , thank you very much for your quick reaction!

from gantt-schedule-timeline-calendar.

Kendzi-x avatar Kendzi-x commented on June 19, 2024 1

Works like a charm, thanks

from gantt-schedule-timeline-calendar.

Kendzi-x avatar Kendzi-x commented on June 19, 2024

under "laggy" I mean that when you scroll with a mouse wheel or trackpad, the scroll always jump to the next/previous row

from gantt-schedule-timeline-calendar.

neuronetio avatar neuronetio commented on June 19, 2024

New functionality has been added in version 3.34.0.
To use it, you need to set the byPixels: true option for each scroll configuration.

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 api.setScrollLeft or api.setScrollTop anywhere in your code, you must pass an absolute offset (not rowId or dataIndex as in normal mode) as an argument.
So when byPixels is set to false - nothing changes, but when set to true then setScrollLeft and setScrollTop work in offset mode (in pixels).

Example setScrollLeft with byPixels enabled:

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
}

from gantt-schedule-timeline-calendar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.