[TextField] Stays focused permanently if disabled is set to true while focused #8811
Closed
1 task done
Labels
bug 🐛
Something doesn't work
component: text field
This is the name of the generic UI component, not the React module!
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.
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
Your Environment
The text was updated successfully, but these errors were encountered: