duetds / date-picker

Duet Date Picker is an open source version of Duet Design System’s accessible date picker. Try live example at https://duetds.github.io/date-picker/
https://www.duetds.com
MIT License
1.73k stars 68 forks source link

A minor change to remove disabled months from the drop down #76

Closed anizovtsev closed 3 years ago

anizovtsev commented 3 years ago

Hello,

I would like to thank you for the component one time more. It's pleasure to customize it. Unfortunately, I have to create something that looks like a calendar for selecting a date in the range of several months. But this small improvement could be interesting for you as well. I noticed that when you set min or max parameter (or both), the month drop down still contains all 12 months. Even thought it's not possible to select one due to min/max property. It can confuse some users (actually this is the only one reason why I had to dig into it). This small fix exclude the items that can't be selected.

WickyNilliams commented 3 years ago

Hey, This PR reminded me that we experimented with this on the internal version of the picker in Duet's design system.

However, we decided it felt a little weird/confusing that there weren't consistently 12 options in the month dropdown. So we went with an alternative approach of disabling any <option> that would fall outside min/max. Like this:

So I won't be merging this, as I will be porting over the above changes. But thanks anyway, appreciate you taking the time. Sorry to be slow!

WickyNilliams commented 3 years ago

PR for the behaviour above: #82

WickyNilliams commented 3 years ago

My version of this fix was released in v1.4.0 @anizovtsev