-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
[Popover] ModalClasses prop regression #16441
Comments
@jeffshaver Your issue is very similar to #16442. The classes API was removed in #15466. You can use the class name API directly. -<Popover open={true} ModalClasses={{ root: classes.test }} />
+<Popover open={true} className={{classes.test}} /> Does it solve your issue? |
@oliviertassinari it solved the issue for me but I had to add an important in the css to override the z-index. |
@francoiscabrol Right, same issue as #16442. |
I guess this wasn't released as a breaking change because the new React warnings are just warnings? |
AFAICT I'm going to have to have a conditional on the version number of |
I would recommend dropping v3 support. |
Okay, I was getting confused because somehow no warnings were showing about the |
@oliviertassinari I was thinking I would have to do different things for different sub-versions of v4, but fortunately I was confused, sorry. |
Yeah, you are right classes doesn't inherit, while className does. |
On Popover, we were using the ModalClasses prop to pass a class to the div that gets mounted for the Modal.
This is broken now. I am not 100% sure on when this regression occurred (maybe on the functional rewrite?).
The problem (I think) is that Modal doesn't pull off classes as a known prop, it just gets spread using
{...other}
. Which means the div gets an attribute calledclasses
and its value is[Object object]
. I think the solution is to have modal pull of classes and as a prop.Another alternative would be to give Popover a
ModalProps
prop instead ofModalClasses
and then spread that onto the Modal component.Second solution seems more flexible.
Expected Behavior 🤔
The div that Modal creates should have the correct classnames.
Current Behavior 😯
The div that Modal creates gets a
classes="[Object object]
attributeSteps to Reproduce 🕹
Link: https://codesandbox.io/s/create-react-app-with-typescript-787wb
Context 🔦
I am trying to pass a class name to the div that the Modal component creates
Your Environment 🌎
The text was updated successfully, but these errors were encountered: