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

Calendar position error when appendTo: 'self' is set #5058

Closed
Traveller23 opened this issue Oct 7, 2023 · 6 comments · Fixed by #5576 or #5717
Closed

Calendar position error when appendTo: 'self' is set #5058

Traveller23 opened this issue Oct 7, 2023 · 6 comments · Fixed by #5576 or #5717
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@Traveller23
Copy link

Traveller23 commented Oct 7, 2023

Describe the bug

When appendTo: 'self' is set for the PrimeReactProvider, the position of the datepicker that appears after clicking on the Calendar is drastically shifted:

1

This is probably because position: absolute was used instead of position: fixed, see the screenshot above.

The style of the calendar's container: width: 20rem; margin: 1rem auto;, very simple.

Reproducer

https://github.com/Traveller23/primereact-nextjs-13

PrimeReact version

10.0.2

React version

18.x

Language

TypeScript

Build / Runtime

Next.js

Browser(s)

No response

Steps to reproduce the behavior

No response

Expected behavior

No response

@Traveller23 Traveller23 added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Oct 7, 2023
@melloware
Copy link
Member

@Traveller23 interested in submitting a PR?

@melloware melloware added Type: Bug Issue contains a defect related to a specific component. and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Oct 7, 2023
@melloware
Copy link
Member

Here is a StackBlitz showing the issue: https://stackblitz.com/edit/react-bzipqg?file=src%2Findex.js

@melloware melloware added this to the 10.0.3 milestone Oct 7, 2023
@melloware
Copy link
Member

Actually you are right if I put appendTo="self" right on the Calendar component it works fine. Its only if its set globally with the PrimeReactProvider the positioning is incorrect.

@Traveller23
Copy link
Author

Traveller23 commented Oct 7, 2023

@melloware I tried adding .p-datepicker {position: fixed !important;}, after the first click on the input control, it displays fine, but on the second click the date-picker simply disappears. So I think there may be other issues.

@melloware
Copy link
Member

Yep something else is definitely going on here.

@habubey habubey modified the milestones: 10.0.3, 10.0.4 Oct 11, 2023
@melloware melloware modified the milestones: 10.0.4, Future Oct 14, 2023
@melloware
Copy link
Member

I would like to retest this when 10.1.0 is released

@melloware melloware added the Status: Pending Review Issue or pull request is being reviewed by Core Team label Nov 18, 2023
@melloware melloware modified the milestones: Future, 10.2.2 Dec 12, 2023
@melloware melloware removed the Status: Pending Review Issue or pull request is being reviewed by Core Team label Dec 12, 2023
melloware added a commit to melloware/primereact that referenced this issue Jan 9, 2024
melloware added a commit to melloware/primereact that referenced this issue Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
4 participants