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(datetime): do not animate to new value when multiple values set #28605

Closed
wants to merge 3 commits into from

Conversation

liamdebeasi
Copy link
Contributor

@liamdebeasi liamdebeasi commented Nov 29, 2023

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 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 1 date is selected

Does this introduce a breaking change?

  • Yes
  • No

Other information

Dev build: 7.5.8-dev.11701293337.112ba209

Steps to test:

  1. Open https://codepen.io/liamdebeasi/pen/jOdvQzg in a StackBlitz.
  2. Scroll to a different month and select a date. Observe that the datetime scrolls back to the initial month.
  3. Open https://codepen.io/liamdebeasi/pen/XWOPyqj (same code sample, just with dev build installed)
  4. Repeat step 2. Observe that the datetime does not scroll back to the initial month.
  5. Using dev tools, set the value of the datetime to ['2023-01-01'] and observe that the datetime scrolls to that date.

@liamdebeasi liamdebeasi changed the title Fw 5667 fix(datetime): do not animate to new value when multiple values set Nov 29, 2023
@github-actions github-actions bot added the package: core @ionic/core package label Nov 29, 2023
@liamdebeasi
Copy link
Contributor Author

This fix is incomplete. The team will refine next week, and someone will work on a proper fix.

github-merge-queue bot pushed a commit that referenced this pull request Jan 18, 2024
…fferent months are set (#28847)

Issue number: resolves #28602

---------

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->

## What is the current behavior?
<!-- Please describe the current behavior that you are modifying. -->

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?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

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?

- [ ] Yes
- [x] No

<!--
  If this introduces a breaking change:
1. Describe the impact and migration path for existing applications
below.
  2. Update the BREAKING.md file with the breaking change.
3. Add "BREAKING CHANGE: [...]" to the commit description when merging.
See
https://github.com/ionic-team/ionic-framework/blob/main/.github/CONTRIBUTING.md#footer
for more information.
-->


## Other information

<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->

Co-authored-by: Liam DeBeasi <liamdebeasi@users.noreply.github.com>

---------

Co-authored-by: Liam DeBeasi <liamdebeasi@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: core @ionic/core package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: Calendar month changes when selecting date on Multiple date mode
1 participant