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
markDisabled does not trigger invalid state #3182
Comments
Only the isValid date and within min/max range conditions are tested. The |
Well, even if for navigation only... I wouldn't think that there is much use in disabling one date to have the user type it anyway. Which then implies the usability of the input is confusing. Someone might just use that to, for example, prevent someone from making appointments during national holidays. If the user would type it, instead of clicking, then it would simply bypass the rule. Thank you for the link though. :) |
@benouat, I would like to ask for a revision of this situation. Can this be considered a bug? |
@rafaelucena I agree that something is not right here. I am still not convinced that we should flag it as bug... A bug is a faulty behaviour of an existing feature. Here the feature to properly disabled some dates (independently of the current displayed month, and not as only visually, for current month, which Let me discuss it internally before moving on. |
@benouat, I understand. Though I would like you to consider this also from the perspective of the usage of it. That would then force the developer to create a second validation internally to check if the date is disabled. But, still, please let me know how the discussion went. Thank you :) |
@rafaelucena Mayby You could fix it by your own in just four easy steps:
;) |
Then this should not be called markDisabled. Intuition tells you that this method do something different |
Bug description:
Using markDisabled, we set the date on the calendar to not be clickable, but it does not prevent the user to type the date by hand.
But, when using minDate or maxDate, everything works as expected.
The state returned when setting a date out of the range is invalid, as using, for example, day 31 of February.
Link to minimally-working StackBlitz that reproduces the issue:
https://stackblitz.com/edit/angular-4mylnm
Versions of Angular, ng-bootstrap and Bootstrap:
Angular: 7
ng-bootstrap: 4.1.2
The text was updated successfully, but these errors were encountered: