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

Scroll to date after changing view preset breaks horizontal scroll #2193

Closed
pmiklashevych opened this issue Jan 4, 2021 · 1 comment
Closed
Assignees
Labels
bug Something isn't working forum Issues from forum not reproducible premium

Comments

@pmiklashevych
Copy link

pmiklashevych commented Jan 4, 2021

https://www.bryntum.com/forum/viewtopic.php?p=81210#p81210

Reproduced in SchedulerPro module/umd bundles
Failed to reproduce in simple Scheduler and SchedulerPro (ES6)

To reproduce modify SchedulerPro/examples/grouping/app.js

import '../_shared/shared.js'; // not required, our example styling etc.
import '../../lib/Scheduler/column/ResourceInfoColumn.js';
import SchedulerPro from '../../lib/SchedulerPro/view/SchedulerPro.js';

const schedulerPro = new SchedulerPro({
    project : {
        autoLoad  : true,
        transport : {
            load : {
                url : './data/data.json'
            }
        }
    },

    resourceImagePath : '../_shared/images/users/',
    appendTo          : 'container',
    startDate         : new Date(2000, 0, 1),
    endDate           : new Date(2099, 11, 31),
    viewPreset        : 'hourAndDay',

    columns : [
        {
            type           : 'resourceInfo',
            text           : 'Name',
            showEventCount : true,
            width          : 220,
            validNames     : null
        }
    ]
});

const timeout = ms => new Promise(resolve => setTimeout(resolve, ms));

const setTimeline = async(date) => {
    console.log('scrolling to date ' + date.toString());
    await schedulerPro.scrollToDate(date, {
        block : 'start'
    });
};

const initializeTimelines = async() => {
    console.log('Setting weekAndMonth');
    schedulerPro.viewPreset = 'weekAndMonth';
    await setTimeline(new Date(2020, 12, 29));

    await timeout(3000);

    console.log('Setting dayAndWeek');
    schedulerPro.viewPreset = 'dayAndWeek';
    await setTimeline(new Date(2020, 12, 1));
};

initializeTimelines();

Build scheduler pro and examples
Go to http://lh/bryntum-suite/schedulerpro/examples/grouping/index.module.html
Wait for the log:

Setting weekAndMonth
scrolling to date Fri Jan 29 2021 00:00:00 GMT+0300 (GMT+03:00)
Setting dayAndWeek
scrolling to date Fri Jan 01 2021 00:00:00 GMT+0300 (GMT+03:00)

See the timeline shows 2021. Drag the scroller a bit to the right. See timeline jumps to 2014.
Снимок экрана 2021-01-04 в 22 54 20

@pmiklashevych pmiklashevych added bug Something isn't working premium forum Issues from forum labels Jan 4, 2021
@matsbryntse matsbryntse added the high-priority Urgent to have fixed label Jan 4, 2021
@matsbryntse matsbryntse added this to the 4.1.0 milestone Jan 4, 2021
@pmiklashevych pmiklashevych self-assigned this Jan 5, 2021
@matsbryntse matsbryntse removed the high-priority Urgent to have fixed label Jan 5, 2021
@pmiklashevych pmiklashevych removed their assignment Jan 6, 2021
@isglass isglass modified the milestones: 4.1.0, 4.1.1 Feb 1, 2021
@pmiklashevych pmiklashevych self-assigned this Mar 3, 2021
@pmiklashevych pmiklashevych removed this from the 4.1.1 milestone Mar 3, 2021
@pmiklashevych
Copy link
Author

This issue is not reproducible in 4.1.0-beta-2 release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working forum Issues from forum not reproducible premium
Projects
None yet
Development

No branches or pull requests

3 participants