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

size argument passed to onResize doesn't seem to be consistent #8528

Closed
stockiNail opened this issue Feb 26, 2021 · 2 comments · Fixed by #8529
Closed

size argument passed to onResize doesn't seem to be consistent #8528

stockiNail opened this issue Feb 26, 2021 · 2 comments · Fixed by #8529

Comments

@stockiNail
Copy link
Contributor

Expected Behavior

Activating the onResize options, I'm expecting to get 2 arguments, chart and size as described in doc and types def:

 onResize(chart: Chart, size: { width: number; height: number }): void;

Current Behavior

With CHART.JS dist/master, the chart is passed correctly but the size doesn't seem correct.
The size is a proxy and doesn't contain any width or height.
The argument is the chart options instance (maybe I'm wrong).

Screenshot 2021-02-26 145039

Steps to Reproduce

See console of https://codepen.io/stockinail/pen/ExgNgXV

Environment

  • Chart.js version: dist/master
  • Browser name and version: FF 86.0
@kurkle
Copy link
Member

kurkle commented Feb 26, 2021

looks like its called as scriptable. first arg is actually context, containing chart.

@stockiNail
Copy link
Contributor Author

looks like its called as scriptable. first arg is actually context, containing chart.

Yes, you are right, I haven't recognized it.

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.

2 participants