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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[charts] Support popper sx props with TS #12254

Closed
alexfauquette opened this issue Feb 28, 2024 · 3 comments 路 Fixed by #12659
Closed

[charts] Support popper sx props with TS #12254

alexfauquette opened this issue Feb 28, 2024 · 3 comments 路 Fixed by #12659
Assignees
Labels
component: charts This is the name of the generic UI component, not the React module!

Comments

@alexfauquette
Copy link
Member

alexfauquette commented Feb 28, 2024

          Good observation, somehow I failed to make it work initially. 馃檲 

So, the following approach "works":

slotProps={{
  popper: {
    sx: {
      [`& .${chartsTooltipClasses.mark}`]: {
        backgroundColor: 'red',
        color: 'black',
      },
    },
  },
}}

But the problem is that TS is not happy 馃檲
Screenshot 2024-02-28 at 11 46 28

Originally posted by @LukasTy in #11150 (comment)

Search keywords:

@github-actions github-actions bot added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Feb 28, 2024
@zannager zannager added the component: charts This is the name of the generic UI component, not the React module! label Feb 29, 2024
@michelengelen michelengelen removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Mar 1, 2024
@JCQuintas JCQuintas self-assigned this Apr 3, 2024
@JCQuintas
Copy link
Member

The cause for this is that @mui/base/Popper doesn't seen to have the sx property. Or at least not export it at build time.

In packages/x-date-pickers/src/internals/components/PickersPopper.tsx we are using @mui/material/Popper instead, which does have the sx prop, so it works as expected there.

Should I look into moving our @mui/base/Popper -> @mui/material/Popper? Or try to fix the base-ui Popper props?

@JCQuintas
Copy link
Member

I ended up creating the MR as the fix seemed simple and changing the libs didn't seem to affect the UI

Copy link

github-actions bot commented Apr 4, 2024

鈿狅笍 This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

@alexfauquette: How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: charts This is the name of the generic UI component, not the React module!
Projects
None yet
4 participants