Skip to content
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

Not scrolling at bottom in few case. If i select tha last date of last month shown in calender. #7

Open
Ashishlog9 opened this issue Oct 20, 2020 · 2 comments

Comments

@Ashishlog9
Copy link

Ashishlog9 commented Oct 20, 2020

I have given max days 350 . So for today max date in my calendar is 4th -5th oct . If i am selecting these date and again opening calendar sending same date as props its not scrolling to that date. Though if i scroll manually date are selected.

<DraggableCalendar
ref={(_) => (this._calendar = _)}
onSelectionChange={this.onSelectionChange}
maxDays={350}
initialSelectedRange={[this.state.initialStartDate, this.state.initialEndDate]}
fullDateRange={this.props.initialDates != undefined ? true : false}
/>

@SmallStoneSK
Copy link
Owner

@Ashishlog9 it not supports auto scrolling to selected date when first rendering now, you can calculate the position of selected dates and scroll to there in the componentDidMount lifecycle function

@Ashishlog9
Copy link
Author

@SmallStoneSK

It has auto scroll enabled with it . If i am selecting any other month in stead of last monnth shown in calender then its working fine but in case of last month its creating issue . Please help i am stuck in this.
Sharing the code of scroll in library.
_scrollToSelecetdMonth() {
if (this._sv) {
let monthIndex = this.getMonthIndex()
let layout = monthLayoutArr[monthIndex]
setTimeout(() => {
this._sv && this._sv.scrollTo({
x: 0,
y: layout.y - 50,
animated: true
});
}, 100);
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants