clauderic / react-infinite-calendar

✨ Infinite scrolling date-picker built with React, with localization, range selection, themes, keyboard support, and more.

Home Page:http://clauderic.github.io/react-infinite-calendar/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Year First calendar doesn't scroll to the current year if nothing is selected

flaviofernandes004 opened this issue · comments

Problem:
The react-infinite-calendar, when parameterized with the display 'year', does not scroll to the current year. This only happens when there is no date selected.

After looking through the code I suspect that I may have found the cause

scrollToIndex={selectedYearIndex !== -1 ? selectedYearIndex : null}

To achieve the desired behavior, the scrollToIndex should have the current year as a fallback instead of null, right?