Reputation: 1803
I am using react-modern-calendar-datepicke in table. In my application, there is date-picker in every row. When the date picker opens from the bottom it's overlapping the values of the date pickers in the below rows.
Check my sample in the sandbox: Open Sandbox
But it works fine when the calendar opens from the top.
I tried to change the z-index but didn't work for me. Does anyone have any solution for this issue?
Upvotes: 0
Views: 3701
Reputation: 1745
It need to change position and z-index on parent element.
Here is simple demo : (Full code you can check bottom SandBox)
<td style={{ position:"relative", zIndex:"999" }}>
<DatePicker
value={selectedDay}
onChange={setSelectedDay}
inputPlaceholder="Select a day"
shouldHighlightWeekends
/>
</td>
Also I modify your code, hope to help you !
Code Sample for you :
P.S. this solution which is also I use in my project.
Hope to help you !
Upvotes: 2