-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[pickers] Implement out-of-the-box behavior to clear input #4450
Comments
Not sure to understand the issue here Do you just mean that the doc should say |
@flaviendelangle I eventually saw the clear button within the popup, but this is not what initially prompted me to create this issue. What prompted me was a failure to understand how MUI actually implements Material Design guidelines for picker components. More specifically, the design describres two properties, first :
And, second :
However, MUI's design is this one : I was expecting the input to be clearable without having to open the popup. I was expecting what the specification states. |
Oh right, we were talking about two distinct subjects So your point would be to add a reset icon at the right of the field when "clearable = true" ? The pickers have just been moved to our team, so we are still catching up with the existing codebase. |
I understand, and I have noticed that very few UI frameworks actually follow the actual Material specifications in regards to user input elements. I have also noticed discrepancies between various component implementations as well (e.g. the Select and Autocomplete have very different APIs even if they mainly offer the same visual styles and UX) In the case of of the Date/Time pickers, I was expecting the clear button to be visible without requiring extra steps to access the functionality. In my engineering classes (over a decade ago, perhaps, but I still remember the recommendations about heurisitcs and user interactions), this kind of design flaw was highlighted a few times. But, most importantly, even MUI correctly implements the clear button elsewhere! The Search input field does follow the specification : So, my point is, unless MUI actually follows a design standard, it will quickly become a mess and frustrate both users and devs. Points to consider. |
For Select / Autocomplete, I think that Autocomplete is a lot more recent and that Select may evolve closer from the Autocomplete API in the future (don't take my word for it, I never worked on it). For the reset button, I will have a look at the other component (thanks for the search example). For the following of the specification in general. The team behind https://github.com/mui-org/material-ui is building a new design system and the foundations to handle several design systems with the same unstyled bricks. |
I understand the time this all requires. Thank you for taking some time to address my concerns. |
it is possible to use |
@zigang93 could you give me a reproduction case ? |
Just to bring some information about the clear button at the end of the search input. The cross you see is not implemented by MUI If On the same demo you can see that the From the behavior of |
Is there a way to get the clearable prop working in "DesktopDateTimePicker", too? |
The demo from @alexfauquette above should probably work for |
Ok, now I got it, there is no built-in integration via a simple Do I also have to reference that
in the package.json or can I just use the latest |
You can use a recent version |
All right. I'll look into it. Thanks! |
Is there any update on a rough timeline for when this will be implemented? The Mui-lab datepicker has this functionality but I'd prefer to more over to mui-x as I'm getting deprecation warnings. |
Hi, Could you describe how you were enabling the clear behavior on the lab ? |
Ah apologies, the clear button from mui/lab appears in the modal view not the input directly. |
any news about this feature? |
Thank you for being interested in this feature. 🙏 |
@Lucas-Henrique-Lopes-Costa It will be included in the next release (6.16.0) 🚀 |
Duplicates
Latest version
Summary 💡
I see this statement at multiple places in the documentation, but this feature seems to be completely missing in the code.
Examples 🌈
Demo
Motivation 🔦
The ability to clear the field is trivial, but essential in certain cases.
The text was updated successfully, but these errors were encountered: