-
-
Notifications
You must be signed in to change notification settings - Fork 195
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
Create a portal to render the calendar #91
Comments
This makes positioning very tricky. I personally had tons of issues with such solutions in popups and other non-body containers. Additionally, in case someone would use React-Calendar independently, this could create styling problems for them. I'd need to give it a thought! |
Had a similar problem here. I try to use the datePicker inside overflow:hidden container so when I open the calendar popup, obviously, the popup is partially hidden and doesn't shown as expected. Thanks! |
You could use |
Hacky workaround: class MyDatePicker extends ReactDatePicker {
renderCalendar() {
const elem = super.renderCalendar();
if (!elem) { return null; }
return (
<Popover
active={this.state.isOpen}
targetEl={this.props.name}
>
{elem}
</Popover>
);
}
}
|
@wojtekmaj I would suggest to implement both option in the calendar render:
As for good example,
|
@asvetliakov there is no renderCalendar method |
@wojtekmaj Could you please describe how to use it? Or do you just mean to set fixed on the date picker so that it does not scroll with the other content? |
That's what I meant. |
I tried with position fixed and dynamically setting top and left in the onCalendarOpen, but override my styles :( |
Right now, when I click on the input, the calendar's HTML is rendered next to the input element.
It would be good render it inside a Portal (https://reactjs.org/docs/portals.html), so that it doesn't interfere with the styling of the input element's container.
The text was updated successfully, but these errors were encountered: