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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TextareaAutosize] Deprecate TextareaAutosize #165

Open
oliviertassinari opened this issue Oct 8, 2023 · 5 comments
Open

[TextareaAutosize] Deprecate TextareaAutosize #165

oliviertassinari opened this issue Oct 8, 2023 · 5 comments
Labels
component: TextareaAutosize The React component. deprecation New deprecation message on hold There is a blocker, we need to wait

Comments

@oliviertassinari
Copy link
Member

oliviertassinari commented Oct 8, 2023

What's the problem? 馃

Today's implementation of TextareaAutosize depends, more or less, on option 1 of https://stackoverflow.com/questions/454202/creating-a-textarea-with-auto-resize, it's more complex because it also supports maxRows and minRows.

Looking at https://github.com/tkent-google/explainers/blob/main/form-sizing.md, it looks like a native solution for this component is coming to the platform. Also see https://twitter.com/jh3yy/status/1710398436917321799.

It looks like we will no longer need this component in a year or two. Time to think of its deprecation path?

Search keywords:

@oliviertassinari oliviertassinari added the component: TextareaAutosize The React component. label Oct 8, 2023
@oliviertassinari oliviertassinari changed the title [TextareaAutosize] Deprecate path [TextareaAutosize] Deprecation path Oct 8, 2023
@oliviertassinari oliviertassinari transferred this issue from mui/material-ui Mar 10, 2024
@colmtuite colmtuite changed the title [TextareaAutosize] Deprecation path [TextareaAutosize] Deprecate TextareaAutosize Mar 21, 2024
@colmtuite
Copy link

Auto-sizing is fine these days with field-sizing, but we discussed potentially recreating this component with <div contenteditable="true"> to support custom scrollbars. However, we can instead put the custom scrollbar on a parent and use :focus-within.

Demo: https://jsfiddle.net/as0r6evg

We can now deprecate this component.

@waigel
Copy link

waigel commented Mar 21, 2024

I have concerns about backwards compatibility. The CSS property mentioned here is currently only available in a new chrome browser version. I don't think it's the right time to deprecate this now. Here is an overview of the support

Image

https://caniuse.com/mdn-css_properties_field-sizing

@colmtuite
Copy link

Support is poor currently yes, but I was told by someone close with CSS that it's expected to be well-supported in the next few months, before our new Textarea component (following our new API design plans) would be roadmapped. So in terms of planning our v1 in late Q3 this year, it makes sense to think about the native implementation.

@oliviertassinari oliviertassinari added deprecation New deprecation message on hold There is a blocker, we need to wait labels Mar 21, 2024
@oliviertassinari
Copy link
Member Author

oliviertassinari commented Mar 21, 2024

馃憤

@oliviertassinari
Copy link
Member Author

oliviertassinari commented Apr 21, 2024

One thing I'm missing with the CSS only implementation: how's do we do max line count? Using max-height: px makes it hard to match line count, especially with different theme density. The results isn't that great.
I guess max-height: 10lh; this unit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: TextareaAutosize The React component. deprecation New deprecation message on hold There is a blocker, we need to wait
Projects
Status: Backlog
Development

No branches or pull requests

3 participants