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

onResize doesn't fire in RTL mode #6057

Closed
abdullahkady opened this issue Feb 8, 2019 · 2 comments
Closed

onResize doesn't fire in RTL mode #6057

abdullahkady opened this issue Feb 8, 2019 · 2 comments
Milestone

Comments

@abdullahkady
Copy link

Expected Behavior

The onResize callback doesn't fire when the document (body) has the direction set to rtl.
This affects responsiveness as well, since the chart doesn't scale correctly when the responsive option is set.

Current Behavior

When resizing, it will work when resizing down (narrowing the chart), and will fail when scaling back up (adding more width to the screen).

Possible Solution

A hack around can be achieved by setting a global listener (on the wrapper element, or say globally on the window), and calling chart.resize() explicitly in it that listener's callback.

Steps to Reproduce (for bugs)

Live example
I sat up this quick example, open up the console and change the width in both RTL, and LTR modes and observe.

Context

Trying to use the chart in a multi-locale website didn't work for rtl languages.

Environment

  • Chart.js version: latest (2.7.3)
  • Browser name and version: chrome, latest (72)
  • Link to your project: codepen
@benmccann
Copy link
Contributor

@abdullahkady would you be able to take a look at #6063 to see if it fixes your issue?

@abdullahkady
Copy link
Author

@abdullahkady would you be able to take a look at #6063 to see if it fixes your issue?

Looks great!
Nicely done @kurkle 🎉

@simonbrunel simonbrunel added this to the Version 2.8 milestone Feb 12, 2019
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

3 participants