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

Scrolling triggers viewport resize on iPhone #206

Closed
Golodhros opened this issue May 10, 2017 · 2 comments
Closed

Scrolling triggers viewport resize on iPhone #206

Golodhros opened this issue May 10, 2017 · 2 comments
Labels
status:completed Finished feature or fix type:bug An unexpected problem or unintended behavior type:documentation A documentation improvement task

Comments

@Golodhros
Copy link
Collaborator

It seems that scrolling is triggering viewport resizes on our demos, thus re-rendering charts.

Reported in https://news.ycombinator.com/item?id=14307608#14308850

@Golodhros Golodhros added type:bug An unexpected problem or unintended behavior type:documentation A documentation improvement task labels May 10, 2017
@Golodhros
Copy link
Collaborator Author

Reproduced in iPhone 6 Plus

nobitagit added a commit to nobitagit/britecharts that referenced this issue May 12, 2017
Avoid triggering a resize when viewport
height changes on the demos.

Close britecharts#206
@nobitagit
Copy link
Contributor

This happens on Android as well (Chrome on Samsung S7, though I guess pretty much anywhere) but it's technically not a bug.

What's happening here is that on certain mobile browsers the address toolbar scrolls out of view when scrolling the page downwards. This in practice resizes the viewport and fires a resize event that is correctly handled by the function in resizeHelper.js.

The simplest trick here is to fire the callback only when the width changes, as in general the change in width is all we care about when dealing with responsive charts. I submitted a PR with a fix for it so you can test if that solves the issue.

miglesiasEB pushed a commit that referenced this issue Dec 3, 2017
Avoid triggering a resize when viewport
height changes on the demos.

Close #206
miglesiasEB pushed a commit that referenced this issue Dec 3, 2017
Avoid triggering a resize when viewport
height changes on the demos.

Close #206
@Golodhros Golodhros added the status:completed Finished feature or fix label Jan 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:completed Finished feature or fix type:bug An unexpected problem or unintended behavior type:documentation A documentation improvement task
Projects
None yet
Development

No branches or pull requests

2 participants