Skip to content

Conversation

@ZeeshanTamboli
Copy link
Member

@ZeeshanTamboli ZeeshanTamboli commented Mar 5, 2024

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

@ZeeshanTamboli ZeeshanTamboli added type: bug It doesn't behave as expected. package: material-ui component: TextareaAutosize The React component. package: @mui/base Specific to @mui/base (legacy). type: regression A bug, but worse, it used to behave as expected. labels Mar 5, 2024
@ZeeshanTamboli ZeeshanTamboli marked this pull request as ready for review March 5, 2024 12:40
@mui-bot
Copy link

mui-bot commented Mar 5, 2024

Netlify deploy preview

https://deploy-preview-41369--material-ui.netlify.app/

Bundle size report

Details of bundle changes (Toolpad)
Details of bundle changes

Generated by 🚫 dangerJS against 5c85931

Copy link
Member

@DiegoAndai DiegoAndai left a 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.

@ZeeshanTamboli ZeeshanTamboli merged commit 27b8c76 into mui:master Mar 8, 2024
@ZeeshanTamboli ZeeshanTamboli deleted the fix-part-of-41315-textareaautosize branch March 8, 2024 16:36
@oliviertassinari
Copy link
Member

oliviertassinari commented Mar 10, 2024

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:

Comment on lines +467 to +468
const { container } = render(<TextareaAutosize style={{ backgroundColor: 'yellow' }} />);
const input = container.querySelector<HTMLTextAreaElement>('textarea')!;
Copy link
Member

@oliviertassinari oliviertassinari Mar 10, 2024

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.

Suggested change
const { container } = render(<TextareaAutosize style={{ backgroundColor: 'yellow' }} />);
const input = container.querySelector<HTMLTextAreaElement>('textarea')!;
render(<TextareaAutosize style={{ backgroundColor: 'yellow' }} />);
const input = document.querySelector<HTMLTextAreaElement>('textarea')!;

@ZeeshanTamboli
Copy link
Member Author

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 fixed 👍.

Next, we still need to:

@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.

@oliviertassinari oliviertassinari removed the type: bug It doesn't behave as expected. label Apr 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: TextareaAutosize The React component. package: @mui/base Specific to @mui/base (legacy). type: regression A bug, but worse, it used to behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants