Skip to content
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

V1.0.0 is having jittery scroll with scroll wheel, not behaving as expected. #490

Open
jonrhaider opened this issue Jan 10, 2025 · 2 comments

Comments

@jonrhaider
Copy link

jonrhaider commented Jan 10, 2025

Hello Frappe team, firstly, I just recently discovered Frappe for a little test project I am working on, and I love it - exactly what is needed, a minimalist gantt with interactivity. Perfect sweet spot between google gantt and the more extensive (and complex) DHTMLX or Bryntum.

I started with the v0.6.1 and things were very smooth, but from the documentation for v1.0.0, it clearly offers more features and customization so I'd like to play around with. I've included the 2 cdn files in the header and here's my sample code (using alpine js + tailwind css - and note I load frappe before alpine loads and initializes):

<script src="https://cdn.jsdelivr.net/npm/frappe-gantt/dist/frappe-gantt.umd.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/frappe-gantt/dist/frappe-gantt.css">

<div x-data="ganttChart()" x-init="initGantt()">
    <div id="gantt"></div>
</div>

<script>
    function ganttChart() {
        return {
            gantt: null,
            tasks: [
                {
                    id: 'Task 1',
                    name: 'Research',
                    start: '2025-01-01',
                    end: '2025-01-05',
                    progress: 80
                },
                {
                    id: 'Task 2',
                    name: 'Development',
                    start: '2025-01-06',
                    end: '2025-01-15',
                    progress: 20
                },
                {
                    id: 'Task 3',
                    name: 'Detailed Design',
                    start: '2025-01-16',
                    end: '2025-01-25',
                    progress: 0
                },
                // ... more tasks
            ],

            initGantt() {
                this.gantt = new Gantt("#gantt", this.tasks, {
                    view_mode_select: true,
                    view_mode: 'Week',
                    scroll_to: 'start'
                });
            }
        }
    }
</script>

Super minimal to test. Again, it works great with v0.6.1, but with v1.0.0 the gantt appears on the page, everything is formatted / styled correctly, and bars are correctly placed, and interactive, but the scroll behavior with scroll wheel is sporadic and unpredictable (very jittery), with no console errors.
Do you see anything wrong with the above simple implementation, or are there any bugs being worked on and I'm too early to be testing v1.0.0? :)

Thanks for your awesome work!

@jonrhaider
Copy link
Author

Just wanted to add / clarify: this only seems to be happening when "infinite_padding" is enabled. When explicitly set to false, the scrolling becomes smooth again.

@safwansamsudeen
Copy link
Collaborator

Thanks for opening a PR! I think we'll turn off infinite_padding for now as we work on improving it. Have you noticed when it becomes jittery?

And please do give us any other feedback for v1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants