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 responsiveAnimationDuration causes flicker on resize #5354

Closed
JMoli opened this issue Mar 20, 2018 · 2 comments · Fixed by #8509
Closed

Setting responsiveAnimationDuration causes flicker on resize #5354

JMoli opened this issue Mar 20, 2018 · 2 comments · Fixed by #8509

Comments

@JMoli
Copy link

JMoli commented Mar 20, 2018

Expected Behavior

The animation should execute without a flicker.

Current Behavior

On resize event the canvas will flicker and then the animation will follow.

Steps to Reproduce (for bugs)

https://codepen.io/elisescolaro/pen/YaGyMW

Context

If you have multiple charts on a single page (with lots of other scripts) this becomes extremely noticeable.

Environment

  • Chart.js version: 2.7.2
  • Browser name and version: Chrome
@etimberg etimberg changed the title [BUG] Setting responsiveAnimationDuration causes flicker on resize Setting responsiveAnimationDuration causes flicker on resize Mar 21, 2018
@etimberg
Copy link
Member

Fiddle using the latest Chart.js that still reproduces the issue: https://codepen.io/anon/pen/xWqrzY

@simonbrunel based on the flamegraph I have an idea. It looks like the draw call fires first, then the resize happens. both use requestAnimationFrame. Perhaps we need a way to force the resize to happen first, before the draw that way we don't draw for the old animation

@kurkle
Copy link
Member

kurkle commented Feb 17, 2020

Still the case with new new animation system: https://codepen.io/kurkle/pen/OJVNwWw

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

Successfully merging a pull request may close this issue.

3 participants