fix(datetime): do not animate to new value when multiple values in different months are set - #28847
Merged
Conversation
added 2 commits
January 17, 2024 13:45
…fferent months are set
averyrousseau
commented
Jan 17, 2024
| const SINGLE_DATE = '2022-06-01'; | ||
| const MULTIPLE_DATES = ['2022-06-01', '2022-06-02', '2022-06-03']; | ||
| const MULTIPLE_DATES_SEPARATE_MONTHS = ['2022-04-01', '2022-05-01', '2022-06-01']; | ||
| const MULTIPLE_DATES_SEPARATE_MONTHS = ['2022-03-01', '2022-04-01', '2022-05-01']; |
Contributor
Author
There was a problem hiding this comment.
This was changed to avoid any of these dates being in the same month as the MULTIPLE_DATES set above.
averyrousseau
marked this pull request as ready for review
January 17, 2024 20:22
averyrousseau
requested review from
liamdebeasi and
sean-perkins
as code owners
January 17, 2024 20:22
liamdebeasi
reviewed
Jan 18, 2024
liamdebeasi
left a comment
Contributor
There was a problem hiding this comment.
Fix works well, just one question on the test.
liamdebeasi
approved these changes
Jan 18, 2024
liamdebeasi
left a comment
Contributor
There was a problem hiding this comment.
Test was missing an annotation, but otherwise looks good!
liamdebeasi
reviewed
Jan 18, 2024
Co-authored-by: Liam DeBeasi <liamdebeasi@users.noreply.github.com>
averyrousseau
enabled auto-merge
January 18, 2024 18:17
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Issue number: resolves #28602
What is the current behavior?
We animate to the new date when the value is changed, but we do not account for multiple selection. This behavior is valuable for when the value is set asynchronously on a different month than what it shown.
However, this is confusing when there are multiple dates selected in different months, because we do not reasonably know which date to animate to.
What is the new behavior?
Datetime no longer animates to the new value if more than one date is selected, and the selected dates aren't all in the same month.
An alternative strategy would be to always animate unless one of the selected dates is in the month currently being viewed. However, this would still mean guessing at which value the user wants to see, which we are trying to avoid.
Based on this PR: #28605
Does this introduce a breaking change?
Other information
Co-authored-by: Liam DeBeasi liamdebeasi@users.noreply.github.com