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

[joy-ui][Textarea] Focused border color is not changed to danger when setting error = true and focus textarea at the same time #39466

Closed
2 tasks done
mwskwong opened this issue Oct 16, 2023 · 3 comments
Labels
component: TextareaAutosize The React component. package: joy-ui Specific to @mui/joy

Comments

@mwskwong
Copy link
Contributor

mwskwong commented Oct 16, 2023

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Steps to reproduce 馃暪

Link to live example:

Edit mui-joy-textarea-focus-and-set-error-bug

Steps:

  1. Make use of a TextArea
  2. Pass a ref to slotProps.textarea.ref
  3. Set error = true and call ref.current?.focus() at the same time, e.g. using button click.

Current behavior 馃槸

The color of the focused border is not changed to danger color.
image

Expected behavior 馃

The focused border color should be changed to danger.

Context 馃敠

This use case is used in React Hook Form error handling after client-side form validation fails to pass when the submit button is clicked.

Your environment 馃寧

npx @mui/envinfo
  System:
    OS: macOS 12.3
  Binaries:
    Node: 16.16.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 8.11.0 - /usr/local/bin/npm
  Browsers:
    Chrome: 117.0.5938.92
    Edge: 118.0.2088.46
    Safari: 15.4
  npmPackages:
    @emotion/react: ^11.11.1 => 11.11.1 
    @emotion/styled: ^11.11.0 => 11.11.0 
    @mui/base: 5.0.0-beta.19 => 5.0.0-beta.19 
    @mui/core-downloads-tracker:  5.14.13 
    @mui/icons-material: ^5.14.13 => 5.14.13 
    @mui/joy: 5.0.0-beta.10 => 5.0.0-beta.10 
    @mui/material:  5.14.13 
    @mui/private-theming:  5.14.13 
    @mui/styled-engine: ^5.14.13 => 5.14.13 
    @mui/system:  5.14.13 
    @mui/types:  7.2.6 
    @mui/utils:  5.14.13 
    @types/react: ^18.2.28 => 18.2.28 
    react: ^18.2.0 => 18.2.0 
    react-dom: ^18.2.0 => 18.2.0 
    typescript: ^5.2.2 => 5.2.2 
@n0ir1
Copy link

n0ir1 commented Oct 16, 2023

#39329

@danilo-leal danilo-leal changed the title [Joy] [Textarea] Focused border color is not changed to danger when setting error = true and focus textarea at the same time [joy-ui][Textarea] Focused border color is not changed to danger when setting error = true and focus textarea at the same time Oct 16, 2023
@mwskwong
Copy link
Contributor Author

#39329

Thanks for that. It does look like the same issue as what I'm experiencing here. I wonder if there is a build that I can test in Codesandbox, just to verify that.

@ZeeshanTamboli
Copy link
Member

I tested it in that PR's build and it functions correctly - https://codesandbox.io/s/joy-ui-cra-ts-forked-kpw2jz?file=/src/App.tsx.

@ZeeshanTamboli ZeeshanTamboli removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Oct 17, 2023
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: joy-ui Specific to @mui/joy
Projects
None yet
Development

No branches or pull requests

5 participants