Skip to content
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

Fix arrow positions when min/max date are reached. #509

Closed
wants to merge 1 commit into from

Conversation

albancho
Copy link

@albancho albancho commented Jul 6, 2020

Hey @vlio20,

Using the date-picker for a new website this week, I've noticed an annoying behavior, which also impacts my previous PR (#502):

  1. When there is a max date, the "next" arrow disappears when you reach this date (that's ok).
    But if you click "previous" arrow, the next arrow comes back, moving other buttons to the left.
    So if you want to click twice the "previous" arrow, the 2nv click will be on the "current date" button, which is annoying for the user.
    To solve this issue, I've just added a width to the button container (the button is 16px, so its parents would be 16px too).

  2. Then checking what is the behavior with double arrows, there is an "*ngIf" on it, which was not consistent with the "simple" arrows one.
    The "*ngIf" on the simple arrows only depends on the config. Then, the "hidden" attribute depends on the min/max date.
    For double arrows, the "*ngIf" also took into account the min/max date, and no "hidden" attribute was used.
    I've splitted it back to have the same behavior as the simple arrows.
    Then I added a conditionnal class to the parent to have the correct width, depending on user config.

Please tell me what you think about that.

@vlio20 vlio20 closed this Aug 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants