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

Page is scrolled when i first time click on the canvas #295

Open
vikdet opened this issue Dec 12, 2017 · 1 comment
Open

Page is scrolled when i first time click on the canvas #295

vikdet opened this issue Dec 12, 2017 · 1 comment

Comments

@vikdet
Copy link

vikdet commented Dec 12, 2017

I am using several canvases on the screen. And when I click on the one, which is partially visible it is scrolled to the top of the window.
I have found that behavior because of if (event.type == "mousedown") { _canvas.focus();. Do you really need to set focus on every click? I suppose that browser will do it automatically does'n it?

@bp74
Copy link
Owner

bp74 commented Dec 13, 2017

Hi, yes you are correct - this line causes the scrolling. I think it was necessary to receive keyboard events, if your would not call the focus() method explicitly, then the keyboard events are not sent. I will do some tests and get back to you asap!

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