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

[fields] The input loses focus after pressing on clear button #12574

Closed
CyanoFresh opened this issue Mar 26, 2024 · 7 comments · Fixed by #12587
Closed

[fields] The input loses focus after pressing on clear button #12574

CyanoFresh opened this issue Mar 26, 2024 · 7 comments · Fixed by #12587
Assignees
Labels
component: pickers This is the name of the generic UI component, not the React module! feature: Keyboard editing Related to the pickers keyboard edition regression A bug, but worse

Comments

@CyanoFresh
Copy link

CyanoFresh commented Mar 26, 2024

Steps to reproduce

Link to live example: (required)
https://mui.com/x/react-date-pickers/date-picker/#clearing-the-value
Steps:

  1. Type in some date
  2. Press on clear button
  3. Try to type again
  4. Grey text (placeholder?) is shown and you couldn't type in numbers. Only for some amount of time (~2 seconds) or until some other random event - couldn't figure it out yet

Focusing on something else and focusing the field again helps

Screen.Recording.2024-03-26.at.20.56.54.mov

Current behavior

Grey text (placeholder?) is shown and you couldn't type in new date

Expected behavior

Value is changable

Context

Issue appeared after upgrading to v7.0.0 from ^6.19.2. Before upgrade everything works as expected

Your environment

npx @mui/envinfo
  Browser: latest Chrome

Search keywords: clear, focus lost, couldn't type

@CyanoFresh CyanoFresh added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Mar 26, 2024
@LukasTy
Copy link
Member

LukasTy commented Mar 27, 2024

Hello @CyanoFresh
Could you clarify if you have problems typing into the Field after the value is cleared?
Or is the problem that Field is no longer focused after clearing the value?

For me it seems that it is more of a visual problem, if I focus on the field after clearing it, the editing works, it's just that the section is not marked as selected.

In any case, there seems to be a regression in the behavior of re-focusing the field after it is cleared—it used to be the case in v6.

@LukasTy LukasTy added regression A bug, but worse component: pickers This is the name of the generic UI component, not the React module! feature: Keyboard editing Related to the pickers keyboard edition and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Mar 27, 2024
@LukasTy LukasTy changed the title [Date Picker] Couldn't type a new date after pressing on clear button [fields] The input loses focus after pressing on clear button Mar 27, 2024
@CyanoFresh
Copy link
Author

@LukasTy I have problems typing in a new value after field is cleared. On the video you can see that placeholder mask is light-grey and I am trying to type - but no value is getting in.
Maybe that's related to the focus - I feel like field container is focused (label is animated to the top), but the actual text input is not focused

@LukasTy
Copy link
Member

LukasTy commented Mar 27, 2024

@CyanoFresh Ok, I can confirm that this is quite a nasty bug.
After clearing the value, you can modify the newly focused input with arrows, but not numbers. 🙈

@LukasTy LukasTy self-assigned this Mar 27, 2024
@michelengelen michelengelen changed the title [fields] The input loses focus after pressing on clear button [pickers][fields] The input loses focus after pressing on clear button Mar 27, 2024
@c1oneman
Copy link

We are having the same issue! Can not enter text into date pickers after clear when we tab into the date fields. The textfield does not fill the value "MM/DD/YYYY" like it normally does and the user can not type.

@LukasTy LukasTy changed the title [pickers][fields] The input loses focus after pressing on clear button [fields] The input loses focus after pressing on clear button Mar 28, 2024
Copy link

⚠️ This issue has been closed.
If you have a similar problem, please open a new issue and provide details about your specific problem.
If you can provide additional information related to this topic that could help future readers, please feel free to leave a comment.

How did we do @CyanoFresh?
Your experience with our support team matters to us. If you have a moment, please share your thoughts through our brief survey.

@LukasTy
Copy link
Member

LukasTy commented Mar 28, 2024

@CyanoFresh, @c1oneman the fix has been merged and will be released with the next version (today or tomorrow).

@c1oneman
Copy link

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: pickers This is the name of the generic UI component, not the React module! feature: Keyboard editing Related to the pickers keyboard edition regression A bug, but worse
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants