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

[TextareaAutosize] Deprecate TextareaAutosize #43720

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

[TextareaAutosize] Deprecate TextareaAutosize #43720

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:

Search keywords:

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

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
Contributor

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

👍

  • I added the deprecation label to be ready for the future.
  • I have added the on hold label as we need to be compatible with the browser list we document. I guess we should have a single set of browsers we support. We are refreshing this list in [core] Update browser support versions #41568. I think we can use on hold label removal to signal when we are ready to implement the deprecation. I suspect that Safari will constrain us the most. From [material-ui] Update browser supports in v6 #40958 (comment), there seems to be a 24 months delay between a feature available in Safari and being able to use it broadly.

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

@oliviertassinari oliviertassinari transferred this issue from mui/base-ui Sep 11, 2024
@oliviertassinari oliviertassinari added the component: TextareaAutosize The React component. label Sep 11, 2024
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: Selected
Development

No branches or pull requests

3 participants