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] Resizing unstable #168

Closed
hyorimitsu opened this issue Feb 29, 2024 · 11 comments · Fixed by #189
Closed

[TextareaAutosize] Resizing unstable #168

hyorimitsu opened this issue Feb 29, 2024 · 11 comments · Fixed by #189
Labels
bug 🐛 Something doesn't work regression A bug, but worse

Comments

@hyorimitsu
Copy link

hyorimitsu commented Feb 29, 2024

Steps to reproduce

Link to live example: https://codesandbox.io/p/sandbox/modest-ellis-gzqt92

Steps:

  1. Attempt to resize the textarea in the provided sandbox link. You'll notice the resizing behavior is erratic and the style {{ backgroundColor: "yellow" }} fails to apply.
  2. Upon downgrading @mui/material to version 5.15.10, both the resizing behavior and style application work as expected.

Current behavior

  • The textarea resizing is unpredictable, leading to a poor user experience.
  • Styles specified (e.g., background color) are not being applied as intended.
15.5.11.mov

Expected behavior

  • The textarea should resize smoothly, without any instability.
  • All specified styles should be correctly applied to ensure consistent design integrity.
15.5.10.mov

Context

No response

Your environment

npx @mui/envinfo
  System:
    OS: Linux 5.10 Alpine Linux
  Binaries:
    Node: 20.11.0 - /usr/local/bin/node
    npm: 10.2.4 - /usr/local/bin/npm
    pnpm: Not Found
  Browsers:
    Chrome: Not Found
  npmPackages:
    @emotion/react: ^11.11.3 => 11.11.3 
    @emotion/styled: ^11.11.0 => 11.11.0 
    @mui/base:  5.0.0-beta.37 
    @mui/core-downloads-tracker:  5.15.11 
    @mui/icons-material: ^5.15.11 => 5.15.11 
    @mui/material: ^5.15.11 => 5.15.11 
    @mui/private-theming:  5.15.11 
    @mui/styled-engine:  5.15.11 
    @mui/system:  5.15.11 
    @mui/types:  7.2.13 
    @mui/utils:  5.15.11 
    @mui/x-charts: ^6.19.5 => 6.19.5 
    @mui/x-data-grid: ^6.19.5 => 6.19.5 
    @mui/x-date-pickers: ^6.19.5 => 6.19.5 
    @mui/x-tree-view: ^6.17.0 => 6.17.0 
    @types/react: ^18.2.58 => 18.2.58 
    react: ^18.2.0 => 18.2.0 
    react-dom: ^18.2.0 => 18.2.0 
    typescript: ^5.3.3 => 5.3.3

Search keywords: TextareaAutosize,resizing,styles,5.15.11

Search keywords:

@hyorimitsu hyorimitsu added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Feb 29, 2024
@danilo-leal danilo-leal changed the title [TextareaAutosize] Resizing unstable and styles not applied in @mui/material v5.15.11 [material-ui][TextareaAutosize] Resizing unstable and styles not applied in v5.15.11 Feb 29, 2024
@nktnet1
Copy link

nktnet1 commented Mar 3, 2024

I am facing a relevant issue with the TextField component set to "multiline" (i.e. textarea) below:

import React from "react";
import { TextField } from "@mui/material";

export default function EmptyTextarea() {
  return (
    <div>
      <TextField
        label="MUI Text Area"
        multiline
        variant="outlined"
        inputProps={{ style: { resize: "vertical" } }}
      />
    </div>
  );
}

The resizeable icon, which should appear at the bottom right corner as a result of the inputProps, is gone.

v5.15.11 bug

When inspecting the element, CSS says

resize: none;

Here is the sandbox:

Changing package.json in the sandbox back to @mui/materal v5.15.10 fixes the issue (i.e. the drag icon is visible again at the bottom right corner).

v5.15.10 works

@ZeeshanTamboli ZeeshanTamboli added bug 🐛 Something doesn't work regression A bug, but worse and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Mar 5, 2024
@ZeeshanTamboli
Copy link
Member

This issue is a regression from mui/material-ui#40789. I've submitted a PR, mui/material-ui#41369, to address the problem of styles not being applied.

@ZeeshanTamboli
Copy link
Member

Style issue is resolved.

@oliviertassinari oliviertassinari transferred this issue from mui/material-ui Mar 10, 2024
@oliviertassinari oliviertassinari changed the title [material-ui][TextareaAutosize] Resizing unstable and styles not applied in v5.15.11 [TextareaAutosize] Resizing unstable and styles not applied in v5.15.11 Mar 10, 2024
@oliviertassinari oliviertassinari changed the title [TextareaAutosize] Resizing unstable and styles not applied in v5.15.11 [TextareaAutosize] Resizing unstable and styles not applied in Material UI v5.15.11 Mar 10, 2024
@ZeeshanTamboli ZeeshanTamboli changed the title [TextareaAutosize] Resizing unstable and styles not applied in Material UI v5.15.11 [TextareaAutosize] Resizing unstable in Material UI v5.15.11 Mar 11, 2024
@nktnet1
Copy link

nktnet1 commented Mar 16, 2024

@ZeeshanTamboli thank you for fixing the style issue!

Do you have any idea what the other issue is? i.e. regarding the glitchy drag in hyorimitsu's original post.

Using your CodeSandbox from mui/material-ui#41369

After: https://codesandbox.io/p/sandbox/compassionate-napier-7tnq6l

This is what I see:

current.mp4

This is what the behaviour used to be like (the video shows 5.11.11 accidentally, but the last working is 5.15.10. Things broke in 5.15.11):
https://codesandbox.io/p/sandbox/mui-textarea-and-textfield-yx88dk?file=%2Fpackage.json%3A13%2C30

expected.mp4

@ZeeshanTamboli
Copy link
Member

@nktnet1 I'm not sure what the problem might be, but I'll take a look.

@hyorimitsu
Copy link
Author

hyorimitsu commented Mar 16, 2024

@ZeeshanTamboli
Thank you for fixing the style issue!

You might already be aware, but just for your reference, I'd like to share my understanding of the bug related to resizing:

I apologize if there has been any misunderstanding.

@ZeeshanTamboli
Copy link
Member

ZeeshanTamboli commented Mar 17, 2024

Thanks to @hyorimitsu for helping to pinpoint the cause of the issue. I've submitted a PR to address it - #189.

@colmtuite
Copy link
Contributor

Auto-sizing can be handled natively these days with field-sizing. So we're going to deprecate this component soon.

Demo

@oliviertassinari
Copy link
Member

oliviertassinari commented Apr 21, 2024

Even if deprecated, it will likely take two years to remove it, the time it will take for browser support to propagate mui/material-ui#43720.

So I'm reopening, there are no real alternatives in production today, and it's still a regression.

If browser support propagates more rapidly, then the considerations would only be about backward compatibility, to give people time to migratre away.

@oliviertassinari oliviertassinari changed the title [TextareaAutosize] Resizing unstable in Material UI v5.15.11 [TextareaAutosize] Resizing unstable Apr 21, 2024
@ZeeshanTamboli
Copy link
Member

ZeeshanTamboli commented Apr 26, 2024

For those who are using @mui/base or @mui/material, this got fixed in mui/material-ui#41638.

@hyorimitsu
Copy link
Author

Thank you for the fix! It is greatly appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work regression A bug, but worse
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants