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

StartFocus causing scroll #19

Closed
EddieOne opened this issue Oct 31, 2016 · 2 comments
Closed

StartFocus causing scroll #19

EddieOne opened this issue Oct 31, 2016 · 2 comments
Assignees

Comments

@EddieOne
Copy link

I changed

this.element.style.top = (-100).toString() + 'px';

to

this.element.style.width = 0;
this.element.style.height = 0;
this.element.style.top = (100).toString() + 'px';

and it seemed to fix them problem of scrolling to the top of a page when an input gains focus.

@AleBles
Copy link
Member

AleBles commented Nov 1, 2016

You'll still be able to scroll up, but it depends on how far down your game is on the page. I haven't tought about setting the width/height to zero but I will test it to see if it'll still work on all device.

@AleBles AleBles self-assigned this Nov 1, 2016
@EddieOne
Copy link
Author

EddieOne commented Nov 1, 2016

I found it worked more as I expected hiding the input off to the left rather than above the game. Since I use iframes to display the game, the absolute is not relative to the page hosting the game. There is still some scrolling, but at least it scroll to the game rather than above it.

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

No branches or pull requests

2 participants