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

The date panel does not update when using both a minimum selection date and mobile mode #20

Closed
davidchoy opened this issue Feb 24, 2021 · 4 comments

Comments

@davidchoy
Copy link

davidchoy commented Feb 24, 2021

Issue: The date panel does not update when using both a minimum selection date and mobile mode.

To reproduce the problem, please see:
https://codesandbox.io/s/datepanel-broken-with-mindate-when-ismobile-3i0cp?file=/src/App.js

I took a cursory look at the code and couldn't figure out how to fix this problem. Can you help or point me in a good direction?

<DatePicker
  value={bookingDates}
  onChange={(dateObjects) => {
    setBookingDates(dateObjects);
  }}
  multiple={true}
  plugins={[<DatePanel />]}
  className="rmdp-mobile" // Remove either this line (className="rmdp-mobile") or the next to fix the DatePanel
  minDate={today} // Remove either this line (minDate={today}) or the next to fix the DatePanel
/>
@davidchoy davidchoy mentioned this issue Feb 24, 2021
@shahabyazdi
Copy link
Owner

I will work on it and let you know about it.

shahabyazdi added a commit that referenced this issue Feb 25, 2021
@shahabyazdi
Copy link
Owner

Hello
The problem you mentioned occurred because in mobile mode, the user-selected dates were stored as a temporary date in a ref.

Storing dates in the ref did not update the calendar, causing this problem.
In version 2.2.1, temporary dates are also stored in the state to avoid this problem.

I hope your problem has been resolved with the changes I made.

@shahabyazdi
Copy link
Owner

I also fixed the runkit problem you mentioned in issue #19 at version 2.2.5.

@shahabyazdi
Copy link
Owner

I'm closing this issue. Please let me know if your problem persists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants