DatePicker Component - Error on Month Switch: "Cannot read properties of null (reading 'focus')" #16720
Labels
Status: Needs Triage
Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
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.
Expected behavior
The DatePicker should switch months without any errors, and the datepicker-panel should appear in the correct position.
The text was updated successfully, but these errors were encountered: