-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[base-ui][material-ui][TextareaAutosize] Fix inline style not getting applied #41369
[base-ui][material-ui][TextareaAutosize] Fix inline style not getting applied #41369
Conversation
Netlify deploy previewhttps://deploy-preview-41369--material-ui.netlify.app/ Bundle size reportDetails of bundle changes (Toolpad) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @ZeeshanTamboli, I have a single suggestion.
We recently committed to only move forward from Base UI repository https://github.com/mui/base-ui so this PR isn't solving the problem. I transferred the issue to Base UI mui/base-ui#168. It's great that we didn't close it, the problem is not truly fixed yet 👍. Next, we still need to:
|
const { container } = render(<TextareaAutosize style={{ backgroundColor: 'yellow' }} />); | ||
const input = container.querySelector<HTMLTextAreaElement>('textarea')!; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer using the screen
. We are moving tests as much as possible to rely on global queries. This is purely to keep the test environment simple. Most of the time, we don't need the notion of a container. We render one element at once on the screen.
const { container } = render(<TextareaAutosize style={{ backgroundColor: 'yellow' }} />); | |
const input = container.querySelector<HTMLTextAreaElement>('textarea')!; | |
render(<TextareaAutosize style={{ backgroundColor: 'yellow' }} />); | |
const input = document.querySelector<HTMLTextAreaElement>('textarea')!; |
@oliviertassinari Noted. However, addressing all of this will require some time, correct? Given that this was a regression, it was crucial to implement an urgent fix in this repository for the upcoming release. Nevertheless, I agree that the fix should also be applied in the Base UI repository - mui/base-ui#177. |
Fix part of mui/base-ui#168 where style was not getting applied. It's a regression from #40789.
Before: https://codesandbox.io/p/sandbox/magical-fermi-nctqps
After: https://codesandbox.io/p/sandbox/compassionate-napier-7tnq6l