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 calendar using appendTo prop is badly positioned if ancestor has padding #4818

Closed
1 of 2 tasks
kglickman opened this issue Dec 4, 2019 · 3 comments · Fixed by #4846
Closed
1 of 2 tasks
Labels

Comments

@kglickman
Copy link

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.

What browser are you working in?
Chrome

What version of the Carbon Design System are you using?
"carbon-components": "^10.7.0",
"carbon-components-react": "^7.7.0",

What offering/product do you work on? Any pressing ship or release dates we
should be aware of?
OpenPages

Steps to reproduce the issue

https://codesandbox.io/s/codesandbox-fyj49

@dakahn dakahn added the severity: 2 https://ibm.biz/carbon-severity label Dec 6, 2019
@dakahn dakahn changed the title DatePicker issues DatePicker calendar not scrolling when appendTo prop is set Dec 6, 2019
@dakahn
Copy link
Contributor

dakahn commented Dec 6, 2019

We're going to use this issue to track the first problem and roll the portal problem into another issue 👍

@kglickman
Copy link
Author

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.

@asudoh
Copy link
Contributor

asudoh commented Dec 6, 2019

@kglickman Thank you for trying to correct - Would you want to suggest a new subject, or directly edit it if you can? Thanks!

@kglickman kglickman changed the title DatePicker calendar not scrolling when appendTo prop is set DatePicker calendar using appendTo prop is badly positioned if ancestor has padding Dec 6, 2019
asudoh added a commit to asudoh/carbon-components that referenced this issue Dec 10, 2019
asudoh added a commit to asudoh/carbon-components that referenced this issue Dec 10, 2019
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.
asudoh added a commit that referenced this issue Jan 10, 2020
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.
joshblack pushed a commit to joshblack/carbon that referenced this issue Jan 13, 2020
…#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.
joshblack pushed a commit to joshblack/carbon that referenced this issue Jan 14, 2020
…#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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants