Skip to content
This repository has been archived by the owner on Jul 29, 2019. It is now read-only.

Feature request: option to use mousewheel for scrolling window even when over timeline-DIV #3734

Open
jugantner opened this issue Dec 14, 2017 · 7 comments

Comments

@jugantner
Copy link

jugantner commented Dec 14, 2017

Hi team,
I currently use the timeline component of visjs to display a historical overview of a wineyards which works perfect. I disabled scrolling by mousewheel without altKey (which means i use ALT as zoomKey, which works perfect) when i now scroll down the page using the mousewheel and the mousepointer is over the timeline-DIV page scrolling stops, because its captured by the timeline component.

It would be nice to have an option now to enable page scrolling by mousewheel especially when a zoomKey is specified.

my configuration:

var options = {
	locale: 'de',
	clickToUse: false,
	height: '700px',
	zoomable: true,
	moveable: true,
	selectable: true,
	zoomKey: 'altKey',
};

I am using the latest version 4.21.0 and didn't find an option.
To use the lib for our needs I commented out line 9619: event.preventDefault(); in function onMouseWheel() to have scrolling page by mousewheel.

Thanks!
Julian

@yotamberk
Copy link
Contributor

Have you tried the 'ClickToUse' option?

@jugantner
Copy link
Author

Hi Yotam,

thanks for your advice to this option. I already tried that. The problem is: I do not want to click first before use. I disabled scrolling without scrollKey, so I cannot see any reason why scrolling (when mouse pointer is above the timeline) is disabled when clickToUse is false.
It would be nice to have an option to use scrolling by mouse wheel even if I am above (with the mouse pointer) the timeline, especially when scolling is disabled without scrollKey. Perhaps this should be the default behaviour then.

Thanks for any other solution
Julian

@yotamberk
Copy link
Contributor

The solution might be simply solved by css defining mouse-events.
I think it's defined to none. If you attach a jsbin with the problem, I'll take a look at it and try to fix it

@omarks
Copy link

omarks commented Jan 15, 2018

I have the same issue after upgrading to the latest vis.js. My issue is that on a smart phone, the timeline takes up the whole window and so it's very difficult to scroll out of it. clickToUse doesn't seem to work with smart phones (at least iPhone). Another option is using vertical scroll but I have to make the timeline window so small for it to work on a phone it then looks odd on a computer.

I'm not sure how this behaviour can be over ridden with css....

Mark

@mikemonaco
Copy link

I would like to request this same feature. If a scrollKey is defined, the user should be able to scroll the page while hovering over the timeline.

@lewisjb
Copy link
Contributor

lewisjb commented Feb 13, 2018

@yotamberk
Copy link
Contributor

This fix can be found in https://github.com/yotamberk/timeline-plus

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

No branches or pull requests

5 participants