almende / vis

⚠️ This project is not maintained anymore! Please go to https://github.com/visjs
7.86k stars 1.48k forks source link

Zoom happening when moving timeline left of right with arrow buttons #4215

Open webwakko opened 5 years ago

webwakko commented 5 years ago

I got 2 functions who handle moving the timeline left or right moveLeft() { this.date = moment(new Date(this.end)).subtract(5,'days').startOf('isoWeek').format() }, moveRight() { this.date = moment(new Date(this.end)).add(5,'days').startOf('isoWeek').format() }

I also use flatpickr to pick the dates.... When clicking the moveleft or moveright buttons the timeline does move to next or previous week, BUT a zoom is happening at that time... While the base range is set to 1 week (5 days, hiding the weekends) .. start: moment.utc(new Date()).startOf('week').format(), end : moment.utc(new Date()).endOf('week').format(),

I would assume it would move to the next or previous week (with a complete weekview) instead of zooming to a 3 day view.

These are my zoom settings, allthough I don't think the problem lies in here : zoomMin: (1000 60 60 24), // one day in milliseconds zoomMax: (1000 60 60 24 31 3), // about three months in milliseconds

What could cause this issue?

mojoaxel commented 5 years ago

@webwakko

Please provide a minimal code example that demonstrates your issue. We recommend using jsbin for that.