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

Option to make the popper top of all DOM elements.

Open athuldom opened this issue 6 years ago • 3 comments

Is your feature request related to a problem? Please describe. When using inside a custum popup or material ui table the popper of the datepicker is going under the view. It should be displayed above the table or popup. Changing the z-index didn't work.

Describe the solution you'd like There should be an option to make the popup overlapping or above all DOM elements. it is going inside the table not displayed above. u275

Describe alternatives you've considered making the position to fixed and dynamically changing the top and left properties may work perfect.

Additional context Add any other context or screenshots about the feature request here.

athuldom avatar Nov 19 '20 04:11 athuldom

You can create a React portal for it outside the normal DOM flow, take a look at Portal by id example. It should then work as you suggest, and you can change the z-index if you need it to be infront of a modal.

simjes avatar Nov 19 '20 14:11 simjes

thank you, it got worked in two step: step 1 - import createPortal import {createPortal} from 'react-dom'; step 2 - add this props to the datePicker:- popperContainer={({children}) => createPortal(children,document.body)}

simple, it got worked in my case. Hope someone may get helpful

athuldom avatar Nov 20 '20 03:11 athuldom

thank you, it got worked in two step: step 1 - import createPortal import {createPortal} from 'react-dom'; step 2 - add this props to the datePicker:- popperContainer={({children}) => createPortal(children,document.body)}

simple, it got worked in my case. Hope someone may get helpful

in my case it's not render editCell when added portal, can you provide your code sir

thinhbg2812 avatar Jan 15 '25 19:01 thinhbg2812