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

Date range picker selecting future date reset the value #13535

Open
arjaym-dev opened this issue Jun 19, 2024 · 3 comments
Open

Date range picker selecting future date reset the value #13535

arjaym-dev opened this issue Jun 19, 2024 · 3 comments
Labels
component: DateRangePicker The React component. component: pickers This is the name of the generic UI component, not the React module! status: waiting for author Issue with insufficient information support: commercial Support request from paid users

Comments

@arjaym-dev
Copy link

arjaym-dev commented Jun 19, 2024

The problem in depth

Click this to see the demo of the said behavior

Step to produce the said behavior:

  • Select from and to date e.g; Jun 19 - Jun 20
  • After selecting from and to date. Now select Jun 21

You'll notice that the from date become Jun 21, then the to date is don't have value. Is there any solution or options for that ?

My workaround solution

  • On onchange of daterange the value return the date in way of ['datefrom','dateto'] i have a condition of if dateto is null or typeof object on my case i make it the dateFrom value as is what its prev value then the dateTo value get the one that i select.

Your environment

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

Search keywords: date range picker, reset value, future, selecting future date
Order ID: 70493

@arjaym-dev arjaym-dev added status: waiting for maintainer These issues haven't been looked at yet by a maintainer support: commercial Support request from paid users labels Jun 19, 2024
@LukasTy
Copy link
Member

LukasTy commented Jun 19, 2024

Hello @arjaym-dev, your described behavior looks like a general rule that is common among most if not all date range pickers.
Here are the examples (in no particular order, just some unordered result from a google search), which are behaving the same:

Could you describe you expected behavior in more detail?
P.S. Your linked codesandbox is not accessible (probably set to private).

@LukasTy LukasTy added status: waiting for author Issue with insufficient information component: pickers This is the name of the generic UI component, not the React module! component: DateRangePicker The React component. and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jun 19, 2024
@arjaym-dev
Copy link
Author

Hello @LukasTy i've already update the link to public you may be able to view it now. Thanksss

@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 Jun 21, 2024
@LukasTy
Copy link
Member

LukasTy commented Jun 21, 2024

@arjaym-dev Thank you for making the codesandbox public, but it still unclear what is your expected behavior.
What do you think is lacking from the component side?
Your commented code causes UX issues—users are basically no longer able to reset the range without other external means.
Also, as shown in the other examples—it seems that most if not all other range picker components are behaving in the same way as @mui/x-date-pickers-pro.

@LukasTy LukasTy added status: waiting for author Issue with insufficient information and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: DateRangePicker The React component. component: pickers This is the name of the generic UI component, not the React module! status: waiting for author Issue with insufficient information support: commercial Support request from paid users
Projects
None yet
Development

No branches or pull requests

2 participants