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] StaticDateTimePicker with desktop UI #17324

Open
nuthinking opened this issue Apr 11, 2025 · 4 comments
Open

[pickers] StaticDateTimePicker with desktop UI #17324

nuthinking opened this issue Apr 11, 2025 · 4 comments
Labels
component: date time picker This is the name of the generic UI component, not the React module! component: pickers This is the name of the generic UI component, not the React module! customization: logic Logic customizability status: waiting for maintainer These issues haven't been looked at yet by a maintainer

Comments

@nuthinking
Copy link

nuthinking commented Apr 11, 2025

I'm trying to migrate out of @material-ui/pickers because it shows the mobile (radial) time picker also on desktop. mui-x DateTimePicker smartly picks the best UI for the current device (radial for mobile, and multi columns for desktop). The problem is that I want to use only the modal (i.e. StaticDateTimePicker) and can't figure out:

  1. Why it doesn't pick automatically the optimal UI, like the field does.
  2. How to tell it to pick one or the other.

How can I emulate the behavior of DateTimePicker modal? Thanks!

@github-actions github-actions bot added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Apr 11, 2025
@michelengelen
Copy link
Member

Hey @nuthinking ... I am not sure I follow completely.
By radial, do you mean the actual analog clockface?

@michelengelen michelengelen added status: waiting for author Issue with insufficient information component: pickers This is the name of the generic UI component, not the React module! customization: logic Logic customizability component: date time picker This is the name of the generic UI component, not the React module! and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Apr 11, 2025
@michelengelen michelengelen changed the title StaticDateTimePicker with desktop UI [pickers] StaticDateTimePicker with desktop UI Apr 11, 2025
@nuthinking
Copy link
Author

Yes, right now I do:

const viewRenderer = this.props.isMobile
            ? renderTimeViewClock
            : (p: any) => renderMultiSectionDigitalClockTimeView({ ...p, timeSteps: { minutes: 1 } });

        const picker =
            type === "date" ? (
                <StaticDatePicker slots={{ actionBar: () => null }} />
            ) : (
                <StaticDateTimePicker
                    value={value}
                    onChange={this.onChange}
                    ampm={is12Hour}
                    disablePast={disablePast}
                    disableFuture={disableFuture}
                    slots={{ actionBar: () => null }}
                    viewRenderers={{
                        minutes: viewRenderer,
                        hours: viewRenderer,
                    }}
                />
            );

But it looks bad!

@github-actions github-actions bot added status: waiting for maintainer These issues haven't been looked at yet by a maintainer and removed status: waiting for author Issue with insufficient information labels Apr 11, 2025
@michelengelen
Copy link
Member

OK, just asking since we did remove the analog clock on all time pickers going forward (v8 will be released on monday). If that is what you want you will have to keep using this version.
Is that fine for you?

@nuthinking
Copy link
Author

What will be the UX on mobile?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: date time picker This is the name of the generic UI component, not the React module! component: pickers This is the name of the generic UI component, not the React module! customization: logic Logic customizability status: waiting for maintainer These issues haven't been looked at yet by a maintainer
Projects
None yet
Development

No branches or pull requests

2 participants