gusparis / react-native-month-year-picker

React Native Month Picker component for iOS & Android
MIT License
105 stars 73 forks source link

[Android] I can still select dates beyond minimumDate and maximumDate #60

Closed apgsn closed 3 years ago

apgsn commented 3 years ago

Hi again Gustavo, I have yet another report: on Android, I set the maximum date to December 2020 with the prop maximumDate={new Date()}, but if I carefully and slowly drag the year column I can still select the next year (2021 in this case). I can't go any further that that luckily. The same goes with minimumDate={new Date()}, I can still select 2019.
Same story with months column on both directions.

Some specs: library v. 1.6.2 (latest), Android v. 10, confirmed on several devices (Huawei, Xiaomi, Nokia).

Can you look into that? Thanks.
In the meantime, Feliz Navidad man.

crystalcase commented 3 years ago

I have experienced that too. I can go even further than only one. If 2010 is the limit, I can go as far as I want to. As long as I don't touch the other column, it does not get reset. Also it would be nice to disable everything beyond min and Max

gusparis commented 3 years ago

Hey! Yeah, I'm aware of that glitch from the very begining...the native NumberPicker component has some weird behavior I had to fix with reflection in the past. I will take a look at it again. Feliz Navidad!

gusparis commented 3 years ago

@crystalcase what do you mean with disable? take them away? lower the opacity?

gusparis commented 3 years ago

:tada: This issue has been resolved in version 1.6.3 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

crystalcase commented 3 years ago

@crystalcase what do you mean with disable? take them away? lower the opacity?

I think both options are good, but I like lowering the opacity more. Like if you disable a TextInput

gusparis commented 3 years ago

The opacity lowering cannot be achvied with NumberPicker, as far as I know. And on Android, it doesn't render many items ahead of selected, so is kinda pointless ux-wise. Plus removing have some weird logic involved, when you change the year and you have unwanted months there, then go to another year with all the months. The way is built, the pickers populate on render, not dynamically.