react-datepicker icon indicating copy to clipboard operation
react-datepicker copied to clipboard

the popper is going inside the popup.

Open athuldom opened this issue 6 years ago • 5 comments

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 ?

popup-Datepicker_issue

Expected behavior the popper must be shown above the popup

Desktop (please complete the following information):

  • OS: windows
  • Browser: chrome,firefox
  • Version: latest

athuldom avatar Jul 06 '20 09:07 athuldom

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

MathisBicheyre avatar Aug 05 '20 18:08 MathisBicheyre

How to use the portals for this issue? any idea? i have not used it before

athuldom avatar Nov 19 '20 04:11 athuldom

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

rikkertkoppes avatar Apr 01 '21 07:04 rikkertkoppes

+1

DerHerrGammler avatar May 27 '21 08:05 DerHerrGammler

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.

stale[bot] avatar Mar 02 '22 22:03 stale[bot]