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

Emotion fix select #34659

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

Emotion fix select #34659

wants to merge 3 commits into from

Conversation

garronej
Copy link
Contributor

@garronej garronej commented Oct 8, 2022

Hello @mnajdova,

Sorry to bother you again, this is yet another following up to 33205.
It was reported to me that the <Select /> component hadn't been fixed by my previous PR.

Best regards,

@@ -115,7 +115,7 @@ const Select = React.forwardRef(function Select(inProps, ref) {
},
...(multiple && native && variant === 'outlined' ? { notched: true } : {}),
ref: inputComponentRef,
className: clsx(InputComponent.props.className, className),
className: clsx(classes.select, InputComponent.props.className, className),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In this component there is no root class. select is expected to be used instead.

@mui-bot
Copy link

mui-bot commented Oct 8, 2022

Details of bundle changes

Generated by 🚫 dangerJS against 922f1ee

@michaldudak michaldudak added component: select This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material labels Oct 12, 2022
Copy link
Member

@mnajdova mnajdova left a comment

Choose a reason for hiding this comment

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

Hey, sorry for the delay, it missed my radar 😁 This class haven't been handled before in this file, so we may be doing something wrong here. Previously this was handled here: https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Select/SelectInput.js#L521 If we change the behavior, we likely need to remove the classes.select from the SelectInput logic no?

@garronej
Copy link
Contributor Author

garronej commented Oct 28, 2022

Hey, sorry for the delay, it missed my radar 😁

No need to apoogies @mnajdova , thank you for reveiwing!

This case is no different from every other case, I applied the same fix.
It's just that in the <Select /> component there's no root property in classes but a select instead.
I don't know why it is so. Do you know? I'm I missing something big?

Previously this was handled here: https://github.com/mui/material-ui/blob/master/packages/mui-material/src/Select/SelectInput.js#L521 If we change the behavior, we likely need to remove the classes.select from the SelectInput logic no?

I got you. I was worried by this as well.
Like for example classes.root beein applied to <Button /> but still passed to the underling <ButtonRoo />
I even patched it it my initial PR:

image

Only to realize that it whas done like that everywhere where there is a sub component (take for example <Checkbox /> and <CheckboxRoot /> for as another example ) so I rolled back my change and just conformed to the pattern:

image

I hope I'm not missing the point.

Have a good day 😊

@garronej
Copy link
Contributor Author

A little up on this :)
Let me know if you expect something more.

Copy link
Member

@mnajdova mnajdova left a comment

Choose a reason for hiding this comment

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

I apologize for the delay. The problem with this PR is that the classes.select is now being handled two times (by two different components) and applied on two different slots. See https://codesandbox.io/s/damp-cookies-3t3wrz?file=/src/App.tsx

image

This is why I proposed for this to be handled in the NativeSelectInput and SelectInput components if possible. If this is not possible, we should remove the logic in those components before handling it. In my opinion this class should be applied here:

classes: inputProps ? deepmerge(classes, inputProps.classes) : classes,
We could try if this would solve the issue.

@garronej
Copy link
Contributor Author

@mnajdova, thank you for coming back to me on this.
I have to invesigate futher.
To be continued.

@ZeeshanTamboli
Copy link
Member

@garronej May I inquire if there are any planned updates regarding this PR?

@garronej
Copy link
Contributor Author

Thank you for bringing this to my attention. I've yet to address @mnajdova's last message as it remains in my backlog, and I haven't had the opportunity to investigate it.

However, I put a great deal of care into crafting this PR. I believe I had valid reasons for the choices I made.

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: select This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material PR: out-of-date The pull request has merge conflicts and can't be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants