the popper is going inside the popup.
I have some fields inside a popup where datepicker is used. but inside the popup the popper of the datepicker is going inside the scroll rather than showing above the popup. I'm working on a reactjs project. How can i acheive it ?
Expected behavior the popper must be shown above the popup
Desktop (please complete the following information):
- OS: windows
- Browser: chrome,firefox
- Version: latest
I'm interested, I have kind of the same issue.
Tried
.react-datepicker-popper {
overflow: visible;
z-index: 2147483647;
}
But it doesnt work. I guess the next thing is to use portals but I have no idea how to display the component in the right position
EDIT: If you use the last version (>3.0.0) you can use the portalIdprop and it will create a portal if it is not defined, thus you can bypass parent's overflow
See https://reactdatepicker.com/#example-portal-by-id
How to use the portals for this issue? any idea? i have not used it before
Simple answer: use portalId property to point to a container where you want your picker to be. If an element with that id does not exist, it is created at the end of the page
I am also running into this problem but it gets a little more complicated. My datepicker was in a dialog element, and the portal automatically created at the end of the document. As a result, it is behind the dialog. z-index does not work here, as the dialog is in its own top-layer (see https://fullscreen.spec.whatwg.org/#top-layer and https://stackoverflow.com/questions/41815069/is-it-possible-to-position-a-div-on-top-of-a-dialog-tag-that-is-not-its-parent)
I am trying to use a custom calendarContainer that wraps the date picker in a dialog element as well. No success yet
+1
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.