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

[pickers] Replace clock on desktop from TimePicker #4483

Closed
MaxMls opened this issue Jun 4, 2020 · 48 comments · Fixed by #7958
Closed

[pickers] Replace clock on desktop from TimePicker #4483

MaxMls opened this issue Jun 4, 2020 · 48 comments · Fixed by #7958
Assignees
Labels
component: pickers This is the name of the generic UI component, not the React module! component: TimePicker The React component. design This is about UI or UX design, please involve a designer new feature New feature or request

Comments

@MaxMls
Copy link

MaxMls commented Jun 4, 2020

with material design

for examples:

Ant Design

chrome default time picker

Requests from users

@oliviertassinari
Copy link
Member

@MaxMls Could you expand on your use case? What's wrong with the Chrome default time picker? What's wrong with the current TimePicker?

@MaxMls
Copy link
Author

MaxMls commented Jun 4, 2020

The default time picker in Chrome works only in the Chrome browser and is very bad for customization, the current TimePickeris bulky and I think it would be nice to have an alternative

@oliviertassinari
Copy link
Member

oliviertassinari commented Jun 5, 2020

Thanks for the details. I would agree that there is improvement potential. I have been keen to drop the Clock version of the time picker on desktop (keeping it for mobile) since I have first tried to use it. However, the usage of the TimePicker isn't frequent (much less than the DatePicker) hence not much a priority. I think that we will need to get more upvotes on this issue before we prioritize it.

@ghost
Copy link

ghost commented Jun 16, 2020

would be nice to have alternatives, time picker isn't that rarely used olivier and indeed clock version isn't best from usability point of view.

@lmb1987
Copy link

lmb1987 commented Jun 16, 2020

This x1000. @oliviertassinari I am a lead designer in charge over overseeing 35 product teams. We get CONSTANT feedback on the analog clock as a time selection device in the Time and DateTime pickers. It's an ok method for picking time on a mobile device. It's a terrible method for picking time on a desktop...I don't think I have ever seen anything but negative feedback on the analog clock time selection.

It's surprising how long it has taken to address this.

@oliviertassinari
Copy link
Member

oliviertassinari commented Jun 16, 2020

@lmb1987 Thanks for the confirmation, I think that we all agree, the clock is not OK on desktop.

Also, I think that https://mui.com/material-ui/react-autocomplete/ can already solve this pain. e.g. cal.com

Screenshot 2022-09-05 at 14 05 02

@swoopapp

This comment has been minimized.

@JStevens127

This comment has been minimized.

@oliviertassinari oliviertassinari changed the title Add a simple time selection mode [TimePicker] Remove clock on desktop Nov 23, 2020
@oliviertassinari oliviertassinari transferred this issue from mui/material-ui-pickers Nov 23, 2020
@mweber-ak

This comment has been minimized.

@sarbazx

This comment has been minimized.

@tranlehaiquan

This comment has been minimized.

@mbrookes

This comment was marked as outdated.

@mdodell
Copy link

mdodell commented Apr 12, 2021

Would there be a way to integrate Material-UI's Text Field with a third-party integration, i.e. something like rc-time-picker?

@JStevens127

This comment has been minimized.

@lmotioc
Copy link

lmotioc commented Feb 14, 2022

Is this in progress? Can I help anyhow?

@jstares
Copy link

jstares commented Apr 12, 2022

Any updates on the removal of the analog clock?

@flaviendelangle
Copy link
Member

I am migrating this issue to https://github.com/mui/mui-x (see our blog post for context)

We all agree that the clock UI is far for perfect on desktop.
I am currently working on fixing bugs, but this one should be done in the coming months.

If you could link other inspiration you like it would help us build the best time picker possible.

@flaviendelangle flaviendelangle added the component: pickers This is the name of the generic UI component, not the React module! label Apr 13, 2022
@flaviendelangle flaviendelangle transferred this issue from mui/material-ui Apr 13, 2022
@jstares
Copy link

jstares commented Apr 13, 2022

@flaviendelangle Something like this picker would be great
https://www.telerik.com/kendo-react-ui/components/dateinputs/datetimepicker/
Another example of this slide style time picker are the native pickers for chrome shown here:
https://v4.mui.com/components/pickers/

@LukasTy LukasTy self-assigned this Jan 24, 2023
@LukasTy LukasTy moved this from Q4 2022 Oct - Dec to Q1 2023 Jan - Mar in MUI X public roadmap Feb 13, 2023
@oliviertassinari oliviertassinari changed the title [pickers] Remove clock on desktop from TimePicker and DateTimePicker [pickers] Replace clock on desktop from TimePicker and DateTimePicker Feb 14, 2023
@ovelilla
Copy link

What do you think about this time picker?:

https://github.com/ovelilla/timepicker-responsive-vanillajs

@LukasTy
Copy link
Member

LukasTy commented Feb 22, 2023

What do you think about this time picker?:

https://github.com/ovelilla/timepicker-responsive-vanillajs

Thank you for this offer. We did consider this "iOS-like" behavior, but decided to go with a solution resembling the "Ant Design" approach. 😉

@flaviendelangle
Copy link
Member

Note that the new architecture will allow you to implement this kind of UI if you prefer it 👍

@buigabor
Copy link

buigabor commented Mar 7, 2023

Now that a stable version of v6 is out, we should be able to replace the analog clock to our custom component, is that right?

@flaviendelangle
Copy link
Member

Yes, we did not document it yet because we want to do a good documentation and not some small example.

You can look at this section of the migration guide and the renderDate / renderTime method in our codebase.

I'm interested in feedback, problem you encounter trying to build a custom view.
The new architecture is very flexible but maybe we miss some features to make it easy to use.

@LukasTy LukasTy moved this from Q1 2023 Jan - Mar to Q2 2023 Apr - Jun in MUI X public roadmap Apr 12, 2023
@JStevens127
Copy link

@LukasTy Amazing news re: #7958 ❤️ !! Quick question that I'm struggling to find an answer for -- how can we switch the Timepicker to use the DigitalClock (instead of the MultiSectionDigitalClock) as you have in your screen recording:

Screen Shot 2023-04-28 at 10 38 51 AM

@LukasTy
Copy link
Member

LukasTy commented Apr 28, 2023

Thank you @JStevens127
We've introduced three new props (thresholdToRenderTimeInASingleColumn, timeSteps, and skipDisabled) for controlling this behavior, depending on how granular you want your options to be: https://mui.com/x/api/date-pickers/time-picker/#props
If I'm not mistaken, the demo used timeSteps.minutes={30} and thresholdToRenderTimeInASingleColumn={100}.
You can use one, the other, or all props to achieve your desired time granularity and look. Just note that if you only increase the threshold, the options list will be somewhat huge and might not produce the best UX.

If you have a limited amount of options you want to render, consider also using the skipDisabled prop in combination with minTime, shouldDisableTime, or any other validation prop to achieve the desired options list.

P.S. You just reminded me to either rename this issue or declare in some other way, that for now it's only the TimePicker that by default got this view because the DateTimePicker is going to get a bit of a redesign and will be introduced via a separate PR. 🙈

@JStevens127
Copy link

JStevens127 commented Apr 28, 2023

Fantastic, the combination of skipDisabled and thresholdToRenderTimeInASingleColumn did the trick for me!!

I've been a MUI/MUI-X user for over 3 years. Love the product, but the TimePicker was always a major sore spot for me. Your work on #7958 is an absolute game changer!

In case it helps, linking another related issue here (perhaps one that can be closed) #5079

Thank you again!

@LukasTy LukasTy changed the title [pickers] Replace clock on desktop from TimePicker and DateTimePicker [pickers] Replace clock on desktop from TimePicker May 1, 2023
@flaviendelangle
Copy link
Member

The doc is here

But on the new UI is available on the last version, you can have a look here

@TonyBrobston
Copy link

@flaviendelangle I ended up finding that doc right after I posted. Though I must be doing something wrong, I can't seem to get it to work. I added it (copy/paste) to our theme/ThemeProvider and I also tried adding it at the component level since viewRenderer is listed in DesktopDateTimePicker, but no dice.

<DesktopDateTimePicker
  open={isOpen}
  onOpen={() => setIsOpen(true)}
  onClose={() => setIsOpen(false)}
  slots={{
    field: ({ InputProps: { ref } }) => (
      <CalendarMonthIcon ref={ref} onClick={() => setIsOpen(true)} />
    ),
  }}
  viewRenderers={{
    hours: renderTimeViewClock,
    minutes: renderTimeViewClock,
    seconds: renderTimeViewClock,
  }}
/>

Will the digital time picker also be released for DateTimePicker and DesktopDateTimePicker?

@LukasTy
Copy link
Member

LukasTy commented May 12, 2023

Will the digital time picker also be released for DateTimePicker and DesktopDateTimePicker?

Yes, it's already in progress: #8819.
Initially, it will only be available on the Desktop version.

Though I must be doing something wrong, I can't seem to get it to work. I added it (copy/paste) to our theme/ThemeProvider and I also tried adding it at the component level since viewRenderer is listed in DesktopDateTimePicker, but no dice.

Here is a working example with the TimeClock as the time view on the DesktopDateTimePicker. 😉

@TonyBrobston
Copy link

@LukasTy Thank you for that example. I now realize I had it implemented correctly and just got confused, I was expecting to see this tab structure; but in any case, this will work! Thank you!
image

@TonyBrobston
Copy link

@LukasTy Actually, is there a way to get those tabs?

@LukasTy
Copy link
Member

LukasTy commented May 16, 2023

Actually, is there a way to get those tabs?

Tabs are hidden by default on desktop mode. You can force them to be available on desktop using slotProps={{ tabs: { hidden: false } }}. 😉

@St1ko
Copy link

St1ko commented May 30, 2023

@LukasTy Will the DateTimePicker at some point have a digital time picker?

@LukasTy
Copy link
Member

LukasTy commented May 30, 2023

Yes, it should be released this Thursday, if all goes according to plan. 👌
#8946

@oliviertassinari oliviertassinari added design This is about UI or UX design, please involve a designer and removed design: ux labels Aug 18, 2023
@joserodolfofreitas joserodolfofreitas removed this from Recently completed in MUI X public roadmap Mar 19, 2024
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! component: TimePicker The React component. design This is about UI or UX design, please involve a designer new feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.