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

DatePicker Component - Error on Month Switch: "Cannot read properties of null (reading 'focus')" #16720

Open
s900bill opened this issue Nov 11, 2024 · 0 comments
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@s900bill
Copy link

Describe the bug

Description When using the PrimeNG DatePicker component, an error occurs when switching months. This results in the following error message:

ERROR TypeError: Cannot read properties of null (reading 'focus') at _DatePicker.updateFocus (primeng-datepicker.mjs:3829:123) at _DatePicker.onOverlayAnimationStart (primeng-datepicker.mjs:4314:16) at DatePicker_div_3_Template_div_animation_overlayAnimation_start_0_listener (primeng-datepicker.mjs:1313:36) at executeListenerWithErrorHandling (core.mjs:25784:12) at wrapListenerIn_markDirtyAndPreventDefault (core.mjs:25816:18) at browser.mjs:4431:13 at Array.forEach (<anonymous>) at browser.mjs:4429:36 at _ZoneDelegate.invoke (zone.js:369:28) at Object.onInvoke (core.mjs:7045:25)

The error causes the datepicker-panel to appear in an incorrect position, and this behavior is also reproducible on the PrimeNG official website's example page for the DatePicker component.

Environment

PrimeNG Version: 18.0.0-beta.3
Angular Version: 18.2.8
Build/Runtime: Angular CLI App
Language: TypeScript
Node Version: 20.16.0
Browser(s): Chrome

Reproducer

No response

Angular version

18.2.8

PrimeNG version

18.0.0-beta.3

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

20.16.0

Browser(s)

Chrome 130.0.6723.117

Steps to reproduce the behavior

Use the DatePicker component in a project or view the example on the PrimeNG documentation website.
Try switching months in the DatePicker dropdown.
螢幕擷取畫面 2024-11-11 142756

Expected behavior

The DatePicker should switch months without any errors, and the datepicker-panel should appear in the correct position.

@s900bill s900bill added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

No branches or pull requests

1 participant