-
Hey guys. At first, thanks for great package, I really enjoyed playing with this for a couple of hours. Unfortunately, I stumbled upon "bug" I cannot resolve by myself. I'm using day-picker to make vertical, scrollable, 24 month long calendar. But as you can see on a GIF, when I click a date later than current month, then the month changes, and the one that got clicked is now first, and there is no way to go back to current month. I am using component with Custom Overlay. My code looks like this: const CustomOverlay = ({ classNames, children, ...props }) => {
const weekdays = ['S', 'M', 'T', 'W', 'T', 'F', 'S'];
return (
<div className={classNames.overlayWrapper} {...props}>
<div className={classNames.overlay}>
<section className="weekdays">
<div className="weekdays__table">
<ul className="weekdays__row">
{weekdays.map((day) => (
<li className="weekdays__day">{day}</li>
))}
</ul>
</div>
</section>
{children}
<button className="scrollable-datepicker__button btn-red--large">APPLY</button>
</div>
</div>
);
};
const ScrollableDatepicker = () => {
const modifiers = {
weekends: { daysOfWeek: [0, 6] },
};
const modifiersStyles = {
weekends: {
color: '#C84332',
},
};
const month = new Date();
return (
<div className="scrollable-datepicker">
<DayPickerInput
month={month}
overlayComponent={CustomOverlay}
showOverlay={true}
hideOnDayClick={false}
placeholder="Heey"
dayPickerProps={{
modifiers,
modifiersStyles,
numberOfMonths: 24,
canChangeMonth: false,
showWeekDays: false,
month,
}}
/>
</div>
);
}; What i tried:
I would really appreciate any help with this. This is a breaking feature for me and if i can't make it working then I'll have to find another package which I don't want because this one is really good to work with. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 5 replies
-
any update on this? |
Beta Was this translation helpful? Give feedback.
-
Hey @brojd, thanks for pinging I don't exactly remember what I did to make it work so I can only give you a little hint and I hope you'll solve it yourself. |
Beta Was this translation helpful? Give feedback.
-
Hey @bilbobag , thanks, I've also figured out solution based on using ref, something like:
|
Beta Was this translation helpful? Give feedback.
-
hi, im doing some job and wonder how did you make the react-day-picker UI into vertical scrolling instead of horizontal prev-next style? thank you very much |
Beta Was this translation helpful? Give feedback.
Hey @bilbobag , thanks, I've also figured out solution based on using ref, something like: