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

[TextField] Stays focused permanently if disabled is set to true while focused #8811

Closed
1 task done
jwheeler-gs opened this issue Oct 23, 2017 · 6 comments
Closed
1 task done
Assignees
Labels
bug 🐛 Something doesn't work component: text field This is the name of the generic UI component, not the React module!

Comments

@jwheeler-gs
Copy link

If a text field is focused by the user when it is disabled via props, the input has its focused visual style retained (label and line under the text remain highlighted in primary color). I tried to work around the issue by calling .blur() on the underlying input element before setting disabled={true}, but it appears that calling .blur() on the input also does not cause the visual styling for TextField to be updated and the input looks like it is still focused. I am not sure if this is the same or a different issue.

  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

I'd expect an input to blur when disabled is set to true if it is focused. Additionally, I'd expect the visual styling to not appear focused when the input is no longer focused.

Current Behavior

Setting disabled=true or calling blur on a focused input does not update the visual styling while the input is focused.

Steps to Reproduce (for bugs)

https://codesandbox.io/s/pp0jl9jzq

  1. Type two characters in the first input to cause it to be disabled.
  2. Click/type in the second input. Notice that both inputs are focused.

Your Environment

Tech Version
Material-UI 1.0.0-beta.17
React 15.6.x
browser Chrome
@oliviertassinari oliviertassinari added bug 🐛 Something doesn't work component: text field This is the name of the generic UI component, not the React module! labels Oct 23, 2017
@mpaarating
Copy link

If no one minds, I am looking into this issue!

@oliviertassinari
Copy link
Member

@mpaarating Yes, please go ahead :).

@oliviertassinari
Copy link
Member

@mpaarating Any lead?

@mpaarating
Copy link

@oliviertassinari it looks like the focused state on the Input component isn't getting updated when handleBlur is getting run. I've not had a chance to have a stab at fixing it, so if you can knock it out, go ahead!

@oliviertassinari
Copy link
Member

@mpaarating Thanks for the info. I will have a look at it 💣.

@NikolaDeveloper
Copy link

It's been 4 years, issue is still there. Is there any workaround?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: text field This is the name of the generic UI component, not the React module!
Projects
None yet
Development

No branches or pull requests

4 participants