Closed coleww closed 5 years ago
Nice work! I'll review this hopefully tonight or tomorrow.
Nice implementation! Found an issue though. Please have a look at the GIF: https://imgur.com/bhdZ1Vo
what is the bug in the gif? and what params are you setting up the datepicker with?
I set the select logic up so that if minDate/endDate are set, the user cannot select a month/year combo that does not contain any valid dates, which seems to be the behavior shown in that gif
Ahh, ok now I understand the issue. I tested this by enabling it on "Range datepicker with input" in /dev/App.vue. And this one has :min-date="'2018-08-28'"
. And in the GIF, I'm selecting 2019, and May. So you are right, it's logical that I cant switch to 2018-05.
Intuitively (at least for me), would be the following:
min-date="2018-08-28"
Select "2019 May" in dropdowns
2018 should still be enabled, but if I choose that, month changes from "May" to first allowed set by min-date (Aug).
Not a must have, but at least in my opinion this would make for a smoother user experience. I can imagine that some users might not understand that they first have to change month to a month later than min-date, and then change year.
Your thoughts on this?
That makes sense to me. I'll update the PR so that the years don't get disabled if they contain any available dates
@MikaelEdebro pushed a commit that removes the year disabling logic. the way generateYears works, it should only ever make year options that have dates within the minDate/endDate range.
Awesome! I'll create a release as soon as possible. I just need to include another fix. Probably this weekend.
Thanks for the contribution @coleww !
Implements #40 and also fixes 2 accessibility bugs on ie11/edge/mobile devices
showMonthYearSelect
andyearsForSelect
propsbugfixes
Object.values
is not supported in ie11)setFocusedDate
in order to fix focus logic across devices (before, focus was being applied inconsistently on mobile as well as ie11/edge)