-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 calendar using appendTo prop is badly positioned if ancestor has padding #4818
Comments
We're going to use this issue to track the first problem and roll the portal problem into another issue 👍 |
The new issue title is inaccurate. The calender is scrolling correctly now that we've added the appendTo. However, it is not positioned correctly underneath the input element. |
@kglickman Thank you for trying to correct - Would you want to suggest a new subject, or directly edit it if you can? Thanks! |
This change inroduces a Flatpickr plugin that ensures that the calendar dropdown is put in the correct floating position even if the floating menu container is changed via `appendTo` and the floating menu container has significant offset from `<body>`. Fixes carbon-design-system#4818.
This change inroduces a Flatpickr plugin that ensures that the calendar dropdown is put in the correct floating position even if the floating menu container is changed via `appendTo` and the floating menu container has significant offset from `<body>`. Fixes #4818.
…#4846) This change inroduces a Flatpickr plugin that ensures that the calendar dropdown is put in the correct floating position even if the floating menu container is changed via `appendTo` and the floating menu container has significant offset from `<body>`. Fixes carbon-design-system#4818.
…#4846) This change inroduces a Flatpickr plugin that ensures that the calendar dropdown is put in the correct floating position even if the floating menu container is changed via `appendTo` and the floating menu container has significant offset from `<body>`. Fixes carbon-design-system#4818.
What package(s) are you using?
carbon-components
carbon-components-react
Detailed description
We had an issue where the calendar popup of the DatePicker did not scroll when the input box scrolled. This is fixed by supplying the appendTo prop and setting it's positioning of that appendTo element to relative.
However, if there is any padding or margins on ancestors of that appendTo element, the calendar popup does not render in the right place. If you comment out the padding, it's fine.
Also, if the DatePicker is rendered in a portal, clicking the calendar icon does not work at all. When I try in my local environment, I get an error about cal not being defined. In the Code Sandbox, it just silently fails.
Steps to reproduce the issue
https://codesandbox.io/s/codesandbox-fyj49
The text was updated successfully, but these errors were encountered: