Skip to content

Datepicker loses alignment when switching to year/month picker when using appendTo="body" #19567

@jonnomk

Description

@jonnomk

Describe the bug

When using appendTo="body", the date picker loses it's alignment when selecting the month/year picker.

Image

Pull Request Link

No response

Reason for not contributing a PR

  • Lack of time
  • Unsure how to implement the fix/feature
  • Difficulty understanding the codebase
  • Other

Other Reason

No response

Reproducer

https://stackblitz.com/edit/nrtwxxny?file=src%2Fapp%2Fdatepicker-basic-demo.ts

Environment

Windows 11

Angular version

21.2.11

PrimeNG version

v21

Node version

No response

Browser(s)

Chrome, Firefox

Steps to reproduce the behavior

When using appendTo="body", the date picker loses it's alignment when selecting the month/year picker.

Click on the input to open the date picker
Note that the date picker is aligned correctly
Click on the year or month selector
Notice that the alignment changes and is wrong
Please check the reproducer.

Expected behavior

The date picker should maintain its alignment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Resolution: Needs More InformationMore information about the issue is needed to find a correct solutionType: BugIssue contains a bug related to a specific component. Something about the component is not working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions