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][DateTimePicker] Layout breaks when no actions are listed #12726

Closed
teryn-trimble opened this issue Apr 9, 2024 · 3 comments · Fixed by #12748
Closed

[pickers][DateTimePicker] Layout breaks when no actions are listed #12726

teryn-trimble opened this issue Apr 9, 2024 · 3 comments · Fixed by #12748
Assignees
Labels
component: DateTimePicker The React component. component: DateTimeRangePicker The React component component: pickers This is the name of the generic UI component, not the React module! regression A bug, but worse

Comments

@teryn-trimble
Copy link

teryn-trimble commented Apr 9, 2024

Steps to reproduce

Link to live example: CodeSandbox

Steps:

  1. When using the DateTimePicker, override the default actions to be an empty array.

Current behavior

On desktop, that breaks the layout so that the time lists move below the date part of the picker.

image

Expected behavior

The layout should remain the same and the action bar should just be empty.

image

Context

Our users were a little confused on the usage of the OK button because it automatically gets accepted with the closeOnSelect being set to true by default. So, we attempted to remove the OK button, but ran into this styling issue.

Your environment

Chrome Version 123.0.6312.106
    System:
    OS: Linux 6.1 Debian GNU/Linux 12 (bookworm) 12 (bookworm)
  Binaries:
    Node: 20.9.0 - /usr/local/bin/node
    npm: 9.8.1 - /usr/local/bin/npm
    pnpm: 8.10.2 - /usr/local/share/npm-global/bin/pnpm
  Browsers:
    Chrome: Not Found
  npmPackages:
    @emotion/react: 11.11.4 => 11.11.4 
    @emotion/styled: 11.11.5 => 11.11.5 
    @mui/material: 5.15.15 => 5.15.15 
    @mui/x-date-pickers: 7.1.1 => 7.1.1 
    @types/react: ^18.2.65 => 18.2.65 
    react: ^18.2.0 => 18.2.0 
    react-dom: ^18.2.0 => 18.2.0 
    typescript: ^5.4.2 => 5.4.2 

Search keywords: picker no actions
Order ID: 3012c2f783dce16e8e6ba9d0719f974fTz03OTAzNCxFPTE3MzE5NjEyNTYwMDAsUz1wcmVtaXVtLExNPXN1YnNjcmlwdGlvbixLVj0y

@teryn-trimble teryn-trimble added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Apr 9, 2024
@michelengelen
Copy link
Member

Hey @teryn-trimble
I did meddle a bit with this and it does seem like there is no easy way to dynamically doe this based on the wrapperVariant. And it does feel wrong that passing in an empty array does break the layout like this.

I will add this to the board.

@LukasTy feel free to answer this if you have a workaround.

@michelengelen michelengelen added bug 🐛 Something doesn't work component: pickers This is the name of the generic UI component, not the React module! component: DateTimePicker The React component. and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Apr 10, 2024
@michelengelen michelengelen changed the title [DateTimePicker] Layout breaks when no actions are listed [pickers][DateTimePicker] Layout breaks when no actions are listed Apr 10, 2024
@LukasTy LukasTy self-assigned this Apr 11, 2024
@LukasTy LukasTy added regression A bug, but worse and removed bug 🐛 Something doesn't work labels Apr 11, 2024
@LukasTy
Copy link
Member

LukasTy commented Apr 11, 2024

FYI, this is a problem with DesktopDateTimeRangePicker as well.

@LukasTy LukasTy added the component: DateTimeRangePicker The React component label Apr 11, 2024
Copy link

⚠️ This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

@teryn-trimble: How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.

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

Successfully merging a pull request may close this issue.

3 participants