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

bug: Calendar month changes when selecting date on Multiple date mode #28602

Closed
3 tasks done
jongbonga opened this issue Nov 29, 2023 · 3 comments · Fixed by #28847
Closed
3 tasks done

bug: Calendar month changes when selecting date on Multiple date mode #28602

jongbonga opened this issue Nov 29, 2023 · 3 comments · Fixed by #28847
Labels
package: core @ionic/core package type: bug a confirmed bug report

Comments

@jongbonga
Copy link

Prerequisites

Ionic Framework Version

v7.x

Current Behavior

When using the Calendar on multiple date mode, if the initial month is November, selecting a date from a different month navigates the view back to the initial month.

Expected Behavior

The calendar month should not navigate automatically when selecting dates from a month that different from the default one.

Steps to Reproduce

  1. Open page with multiple date calendar
  2. Navigate to a different month
  3. select a date

Code Reproduction URL

https://ionicframework.com/docs/api/datetime#multiple-date-selection

Ionic Info

Ionic:

   Ionic CLI                     : 6.20.9 (/Users/jonathan/.nvm/versions/node/v16.14.0/lib/node_modules/@ionic/cli)
   Ionic Framework               : not installed
   @angular-devkit/build-angular : 16.2.10
   @angular-devkit/schematics    : 16.2.10
   @angular/cli                  : 16.2.10
   @ionic/angular-toolkit        : 10.0.0

Capacitor:

   Capacitor CLI      : 5.5.1
   @capacitor/android : 5.5.1
   @capacitor/core    : 5.5.1
   @capacitor/ios     : 5.5.1

Utility:

   cordova-res : 0.15.4
   native-run  : 2.0.0

System:

   NodeJS : v16.14.0 (/Users/jonathan/.nvm/versions/node/v16.14.0/bin/node)
   npm    : 8.3.1
   OS     : macOS Unknown

Additional Information

No response

@ionitron-bot ionitron-bot bot added the triage label Nov 29, 2023
@liamdebeasi liamdebeasi self-assigned this Nov 29, 2023
@liamdebeasi
Copy link
Contributor

Thanks for the report. The problem here is 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.

@liamdebeasi liamdebeasi added package: core @ionic/core package type: bug a confirmed bug report labels Nov 29, 2023
@ionitron-bot ionitron-bot bot removed the triage label Nov 29, 2023
@liamdebeasi liamdebeasi removed their assignment Nov 29, 2023
github-merge-queue bot pushed a commit that referenced this issue 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 <[email protected]>

---------

Co-authored-by: Liam DeBeasi <[email protected]>
@averyjohnston
Copy link
Contributor

This has been resolved via #28847 and the fix will be available in a future release of Ionic Framework. Thank you!

Copy link

ionitron-bot bot commented Feb 17, 2024

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Feb 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: core @ionic/core package type: bug a confirmed bug report
Projects
None yet
3 participants