Skip to content

[TextareaAutosize] Prevent placeholder from affecting height #46556

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

Conversation

Mohammadreza-Sarvari
Copy link

@Mohammadreza-Sarvari Mohammadreza-Sarvari commented Jul 18, 2025

Fixed #46543

Summary:

TextareaAutosize ignores placeholder text when measuring height for auto-resize and ensures long placeholders do not cause unintended row expansion.

Before:

before.mov

After:

after.mov

@mui-bot
Copy link

mui-bot commented Jul 18, 2025

Netlify deploy preview

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

Bundle size report

Bundle Parsed Size Gzip Size
@mui/material 🔺+10B(0.00%) 🔺+1B(0.00%)
@mui/lab 0B(0.00%) 0B(0.00%)
@mui/system 0B(0.00%) 0B(0.00%)
@mui/utils 0B(0.00%) 0B(0.00%)

Details of bundle changes

Generated by 🚫 dangerJS against 6d3b316

@Mohammadreza-Sarvari
Copy link
Author

Dear @ZeeshanTamboli and @mj12albert, could you please review this PR? Thanks

@Mohammadreza-Sarvari Mohammadreza-Sarvari force-pushed the fix/text-area-auto-size-placeholder branch from 8f93d36 to 08ab634 Compare July 18, 2025 09:17
@Mohammadreza-Sarvari Mohammadreza-Sarvari force-pushed the fix/text-area-auto-size-placeholder branch from 08ab634 to 6d3b316 Compare July 18, 2025 09:26
Copy link
Member

@ZeeshanTamboli ZeeshanTamboli left a comment

Choose a reason for hiding this comment

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

@Mohammadreza-Sarvari Thanks for the PR. But I misunderstood the issue earlier. See #46543 (comment). I think the fix is not needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: TextareaAutosize The React component.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[TextareaAutosize] Adds new row for long placeholder if nowrap is applied
3 participants