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

Setting to prevent page scroll on input text focus #13

Closed
CreativeSparkStudios opened this issue Aug 27, 2016 · 4 comments
Closed

Setting to prevent page scroll on input text focus #13

CreativeSparkStudios opened this issue Aug 27, 2016 · 4 comments
Assignees
Labels

Comments

@CreativeSparkStudios
Copy link

I'm using this plugin for a phaser game, when players enter their name for the high score list, and everything is working very well. One small issue, though, is that the html page that the game is embedded in scrolls to the very top of the page when the text field is clicked. This happens in both Chrome, FireFox, Opera, Edge, and IE.

I'm wondering if it would be possible to add a flag that could prevent this behaviour? Or maybe there's some workaround for it?

@AleBles
Copy link
Member

AleBles commented Aug 29, 2016

Hmm yeah, we made the assumption with this plugin that the game is mostly on the top of the page. We have hidden input boxes placed outside the screen (I think there was an issue with them beeing under the canvas) and I'm thinking this makes your browser scroll to the top.

It doesn't happen with any of our games, because we put them all in iframes. I could have a look at either placing the input fields somewhere else, or seeing if I can disable the browsers default behaviour to no scroll to the active input fields

@AleBles AleBles self-assigned this Aug 29, 2016
@AleBles AleBles added the bug label Aug 29, 2016
@CreativeSparkStudios
Copy link
Author

Thanks for the explanation. Either of those solutions would be great.

@CreativeSparkStudios
Copy link
Author

Awesome, thanks :-)

@flafrancesca
Copy link

Hi,

i have the same problem. My game is not at top of the page; so, when i click on the input field, the page scroll to top.

I'm using phaser-input - version 2.0.5 .

Thank you for your support.

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

No branches or pull requests

3 participants