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

[charts] Fix charts not passing className to root element #13647

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

JCQuintas
Copy link
Member

@JCQuintas JCQuintas commented Jun 27, 2024

  • Fix conformance for all charts in 'mergeClassName', 'propsSpread', 'refForwarding', 'reactTestRenderer', 'rootClass'
  • Refs passed to ResponsiveChartContainer go to wrapper div instead of svg element. Breaking? ⚠️
  • Forward ref from Gauge and PieChart components
  • Prevent MediaQueryList error on jsdom

fixes #13292

@JCQuintas JCQuintas added bug 🐛 Something doesn't work component: charts This is the name of the generic UI component, not the React module! labels Jun 27, 2024
@JCQuintas JCQuintas self-assigned this Jun 27, 2024
@mui-bot
Copy link

mui-bot commented Jun 27, 2024

Deploy preview: https://deploy-preview-13647--material-ui-x.netlify.app/

Generated by 🚫 dangerJS against 067f8f7

Copy link
Member

@alexfauquette alexfauquette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refs passed to ResponsiveChartContainer go to wrapper div instead of svg element. Breaking? ⚠️

Yes, this seems to be breaking change. Even if it's not the standard, their is some consistency by always passing the ref to the SVG component.

@JCQuintas
Copy link
Member Author

JCQuintas commented Jul 3, 2024

Yes, this seems to be breaking change.

I don't remember if we decided to do V8 or not 😅, should we wait to merge this?

Even if it's not the standard, their is some consistency by always passing the ref to the SVG component.

I think if it is necessary to have it always on the SVG we could have a proper svgRef that can be passed in? 🤔 Conformance tests don't properly work without the ref there 😅

@alexfauquette
Copy link
Member

I don't remember if we decided to do V8 or not 😅, should we wait to merge this?

The v8 should be in 6 months

I think if it is necessary to have it always on the SVG we could have a proper svgRef that can be passed in?

This would not fix the breaking change aspect. Someone using the ref to access the SVG will get access to a wrapping div after this modification

Conformance tests don't properly work without the ref there

Is it the main reason to do the modification?

@JCQuintas
Copy link
Member Author

This would not fix the breaking change aspect. Someone using the ref to access the SVG will get access to a wrapping div after this modification

I didn't mean it as a solution, but rather as a feature. If we want the user to always have access to the SVG directly, we can have a prop that does exactly that. Otherwise I think the ref should probably go to the topmost element. Though I don't know how we handle it in the main lib.

My point of view is that if I have the topmost ref I can get any of the children elements I need, though I also see it being useful to have a ref directly to the SVG element.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: charts This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[charts] Charts don't pass className to root element
3 participants