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: Datetime throws error when blurring picker quickly #26559

Closed
4 of 7 tasks
Marius-Romanus opened this issue Jan 3, 2023 · 3 comments
Closed
4 of 7 tasks

bug: Datetime throws error when blurring picker quickly #26559

Marius-Romanus opened this issue Jan 3, 2023 · 3 comments
Labels
package: core @ionic/core package type: bug a confirmed bug report

Comments

@Marius-Romanus
Copy link

Prerequisites

Ionic Framework Version

  • v4.x
  • v5.x
  • v6.x
  • Nightly

Current Behavior

When changing the time of the datetime, and quickly clicking outside (blur), it gives an error. It can be seen in the Firefox console.

Uncaught TypeError: activeElement is null

if (activeElement.disabled) {
  return;
}

Expected Behavior

expected no error

Steps to Reproduce

In the ionic example itself you can see:

https://ionicframework.com/docs/api/datetime#basic-usage

  • Select an hour and quickly press outside.
  • Observe the error in the firefox console.

Code Reproduction URL

No response

Ionic Info

Ionic:

Ionic CLI : 6.20.6
Ionic Framework : @ionic/angular 6.4.1
@angular-devkit/build-angular : 15.0.4
@angular-devkit/schematics : 15.0.4
@angular/cli : 15.0.4
@ionic/angular-toolkit : 7.0.0

Capacitor:

Capacitor CLI : 4.6.1
@capacitor/android : 4.6.1
@capacitor/core : 4.6.1
@capacitor/ios : not installed

Utility:

cordova-res : 0.15.4
native-run : 1.7.1

System:

NodeJS : v18.12.1
npm : 9.2.0
OS : Windows 10

Additional Information

No response

@ionitron-bot ionitron-bot bot added the holiday triage issues that were created during holiday period label Jan 3, 2023
@ionitron-bot
Copy link

ionitron-bot bot commented Jan 3, 2023

Thanks for the issue! This issue has been labeled as holiday triage. With the winter holidays quickly approaching, much of the Ionic Team will soon be taking time off. During this time, issue triaging and PR review will be delayed until the team begins to return. After this period, we will work to ensure that all new issues are properly triaged and that new PRs are reviewed. In the meantime, please read our Winter Holiday Triage Guide for information on how to ensure that your issue is triaged correctly. Thank you!

@sean-perkins sean-perkins changed the title bug: Error when blurring quickly on datetime bug: Datetime throws error when blurring picker quickly Jan 3, 2023
@sean-perkins sean-perkins added package: core @ionic/core package type: bug a confirmed bug report labels Jan 3, 2023
@ionitron-bot ionitron-bot bot removed the holiday triage issues that were created during holiday period label Jan 3, 2023
@sean-perkins
Copy link
Contributor

Hello @Marius-Romanus thanks for reporting this issue!

I see the issue and will categorize this as a bug in our backlog.

Note for the team when we fix this, we are incorrectly narrowing the type here: https://github.com/ionic-team/ionic-framework/blob/main/core/src/components/picker-column-internal/picker-column-internal.tsx#L257

It should be:

as HTMLButtonElement | null;

Which then throws appropriate linting errors that the object can possibly be undefined. We should then update the implementation below to account for the active element possibly being null.

@ionitron-bot
Copy link

ionitron-bot bot commented Feb 3, 2023

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 3, 2023
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
Development

No branches or pull requests

2 participants