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][DateTimeRangePicker] selecting the same date for the second part of the range does not work as expected #12586

Closed
cwittlinger89 opened this issue Mar 28, 2024 · 10 comments · Fixed by #12604
Assignees
Labels
bug 🐛 Something doesn't work component: DateTimeRangePicker The React component component: pickers This is the name of the generic UI component, not the React module! support: pro standard Support request from a Pro standard plan user. https://mui.com/legal/technical-support-sla/

Comments

@cwittlinger89
Copy link

cwittlinger89 commented Mar 28, 2024

Steps to reproduce

Link to live example: (required)

Steps:

  1. Go to the official documentation of Mui-X: https://mui.com/x/react-date-pickers/date-time-range-picker/#use-a-single-input-field
  2. Click on today
  3. Click on 4, 00, PM
  4. Click on today
  5. Click on 5, 00, PM

Current behavior

The first time switches to 12:00 PM

Expected behavior

The first time should stick with 4:00 PM and do not jump back to 12:00 PM

Context

No response

Your environment

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Search keywords: DatetimeRange Picker
Order ID: 77969

@cwittlinger89 cwittlinger89 added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Mar 28, 2024
@cwittlinger89
Copy link
Author

Here a video detailing the bug:
Screencast from 2024-03-28 08-50-54.webm

@cwittlinger89
Copy link
Author

I have tried it under Firefox and Chrome

@zannager zannager added component: pickers This is the name of the generic UI component, not the React module! support: pro standard Support request from a Pro standard plan user. https://mui.com/legal/technical-support-sla/ labels Mar 28, 2024
@michelengelen
Copy link
Member

@LukasTy It does seem like clicking the previously selected date will reselect the starting range and not even focus the endrange value as well.

It is also broken on the other DateTimeRangePicker components, not only the one with the single input field

@michelengelen michelengelen added bug 🐛 Something doesn't work 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 Mar 28, 2024
@michelengelen michelengelen changed the title DateTimeRange Picker does not work properly when selecting the same date for the second part of the range [pickers][DateTimeRangePicker] selecting the same date for the second part of the range does not work as expected Mar 28, 2024
@LukasTy LukasTy self-assigned this Mar 29, 2024
@LukasTy LukasTy added component: DateTimeRangePicker The React component and removed component: date time picker This is the name of the generic UI component, not the React module! labels Mar 29, 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 @cwittlinger89?
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 29, 2024

@cwittlinger89 Thank you for reporting this and trying the new component! 🙏
May I ask you, how do you like it?
Do you see any problems with it, or something missing?
The fix has been merged and will be released in around a week. 😉

@cwittlinger89
Copy link
Author

@LukasTy
thank you for the swift response regarding the hotfix.

Until now we are using a lot of Mui(x) components and are generally very happy about them. The Datetime Range picker was something we are looking forward to since December, as it is our last non-mui component that we have to fully maintain.

From a first glance we like it, however there is one thing that takes a bit getting used to:

  • Our Picker: First Date, Second Date, First Time, Second Time
  • Mui Picker: First Date, First Time, Second Date, Second Time

As we have not yet released the mui-picker due to the aforementioned bug, we do not know how our users will react to this change. Generally speaking it would be cool if our methodology would be supported as well.

@cwittlinger89
Copy link
Author

cwittlinger89 commented Apr 2, 2024

@LukasTy I could have sworn that it worked earlier with 7.1.0, now it again does not work at all.

@LukasTy
Copy link
Member

LukasTy commented Apr 2, 2024

@cwittlinger89 It shouldn't have worked before the fix, the code is deterministic and will always result in the first day being overridden if the same day is selected.
The only way that selected on the same day will work is if you do not touch the start time (keep it at midnight).

As for your comment regarding the selection flow, I've created a separate issue with more information for it: #12635.
Please feel free to interact with it and thank you for your valuable feedback! 🙏

@cwittlinger89
Copy link
Author

@cwittlinger89 It shouldn't have worked before the fix, the code is deterministic and will always result in the first day being overridden if the same day is selected. The only way that selected on the same day will work is if you do not touch the start time (keep it at midnight).

When will this fix be live? Because under 7.1.0 it does not work.

As for your comment regarding the selection flow, I've created a separate issue with more information for it: #12635. Please feel free to interact with it and thank you for your valuable feedback! 🙏

I will

@LukasTy
Copy link
Member

LukasTy commented Apr 2, 2024

When will this fix be live? Because under 7.1.0 it does not work.

With the next release that we usually do every Thursday (it is sometimes delayed in case of a complex release-changelog).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: DateTimeRangePicker The React component component: pickers This is the name of the generic UI component, not the React module! support: pro standard Support request from a Pro standard plan user. https://mui.com/legal/technical-support-sla/
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants