-
Notifications
You must be signed in to change notification settings - Fork 12
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
[BUG] RangePicker does not allow selecting of a range covering some disabled days #18
Comments
Hey @coling, if you want to be able to select them, we can add a prop to be able to select disable days in the range, for example, that name can be What do you thinking about that? |
I think having a prop to override the behaviour would be a fine solution and give flexibility. On the naming of it however, I'd suggest something different perhaps |
@coling |
Thanks for the fixes (not had a chance to test them yet - looks OK at first glance!) but the README.md had some trailing fluff in it. I've fixed that up in #19 Hope that helps. |
@coling Hey, I didn't release a version for it, I have a problem with the new version of the storybook, and the build is failed. |
Yeah, seems it's related to typescript 4.3 as covered in this storybook issue. Pinning it to "4.2.x" (and getting 4.2.4) in package.json allowed me to run storybook fine here. I can push a PR for that change for now if you want to release this, but no rush on my part (I did test the changes in Storybook tho', and works great - thanks!!) |
@coling Yes, exactly the problem comes from the typescript |
Thanks @coling |
Awesome! Thanks so much. Will hopefully be using this component soon and will try and spend some time improving it generally in the future as needs arise 😃 |
Actually, it seems the package.json doesn't have a version bump in it. Is it just a matter of bumping this or, because of the github tag do we need to push it right up to version 1.6.5 in package.json and release/tag it? |
@coling Ahh, I see sorry about that. |
Expected Behavior
I wish to use the Range Picker to select a start day and end date. Check-ins and Check-outs must be Saturdays, so
disabledDays
is populated such that it includes all dates which are not Saturdays.I expect to be able to select the range of my choice.
Current Behavior
Selecting the start date is fine, but when selecting the end date, the
onChange
event fires with a "to" value the same as "from" (i.e. it appears to be clamped to the first non-disabled day).Possible Solution
The Range Picker shouldn't clamp the output to
disabledDays
and return the to value the user chose.Your Environment
Additional Comments
Simple reproduction case:
If you select, e.g. the 7th August, and then select 14th of August as the end date, the onChange event will return log
Object { from: "2021-08-07", to: "2021-08-07" }
, i.e. starting and ending on the 7th. I've done more extensive testing allowing a few days to be non-disabled after the start date and it does set the "to" value to be as long as possible up to the first non-disabled date.I presume this is a valid use case for "disabledDays" (the meaning of them being "disabled" changes slightly after the start day has been selected - it can (as in this case) mean an invalid choice of end date, rather than something which cannot be spanned)
Thanks for the awesome component BTW :-)
The text was updated successfully, but these errors were encountered: