Fix arrow positions when min/max date are reached. #509
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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):
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).
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.