question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: datetime, month/year selection with cancel/done buttons has confusing UX

See original GitHub issue

Prerequisites

Describe the Feature Request

Event should be emitted when user changes view from default to month/year selection opened when clicked on top left button in the datepicker and back to default view.

Describe the Use Case

I am showing ion-datetime in a modal. When I want to select a date in one of the past years, I must click on the month/date button in top left corner. If I then select wanted month and year, and click on done, modal closes and value is set to previously select date. This behaviour is frustrating, because many users don’t expect modal to be closed with previously selected value.

Describe Preferred Solution

If an event is emitted when these views are toggled, we can handle custom behaviour (show and hide DONE button for example) and prevent users from exiting modal unintentionally.

Describe Alternatives

No response

Related Code

<ion-button id="open-modal">Open Datetime Modal</ion-button>
<ion-modal trigger="open-modal" [backdropDismiss]="false">
  <ng-template>
    <ion-content>
      <ion-datetime
        size="cover"
        [disabled]="false"
        [max]="'2050-12-31'"
        [(ngModel)]="date"
        (ionChange)="updateValue($event)"
        [showDefaultButtons]="true"
      >
      </ion-datetime>
    </ion-content>
  </ng-template>
</ion-modal>

Additional Information

https://user-images.githubusercontent.com/85163599/160097525-deb50edf-1c29-4f08-9c72-6fe5d7cc979a.mov

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
babycourageouscommented, Apr 14, 2022

@realappie if it is any help I have used a variation on this suggestion while the ionic team works on tackling this bug - https://github.com/ionic-team/ionic-framework/issues/24962#issuecomment-1093108511

0reactions
ionitron-bot[bot]commented, May 29, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Date-Input Form Fields: UX Design Guidelines
This article discusses common input patterns, error handling, and international input for date fields. Date-Input Patterns. Calendar pickers are ...
Read more >
How to Design a Perfect Date Picker? - UX World
To select a date, it is better to provide most common options at first place so that user can select the required option...
Read more >
Bad Practices on Birthdate Form Fields - UX Movement
Asking users for their birthdate on a form is complicated. ... because they have to click tiny arrow buttons to select the year...
Read more >
Date Picker Design Best Practices | by Nick Babich - UX Planet
Date picker is an input field that allows you to select dates through textual input ... Design for seamless movement between day-month-year.
Read more >
Best practice for date-of-birth form fields | by H Locke - Medium
... usable UX and UI design pattern for a date-of-birth form field and was ... confused users and increased the likelihood of user...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found