react-datepicker icon indicating copy to clipboard operation
react-datepicker copied to clipboard

Year dropdown scroll defaults to center of list

Open AbilityMaster opened this issue 3 years ago • 5 comments

I'm using the showYearDropdown prop and maxDate prop on the datepicker but when I click the year dropdown, it will always start at the center of list. Is there a way to set the default value of the dropdown to the current year?

How it opens now: image

How it is expected to be opened: image

AbilityMaster avatar May 30 '22 23:05 AbilityMaster

Same behavior is happening for me too @AbilityMaster any solution so far?

anas510 avatar Jun 02 '22 14:06 anas510

@anas510 , @AbilityMaster Is there a solution to this problem?

kit52 avatar Sep 13 '22 10:09 kit52

@anas510 , @AbilityMaster Is there a solution to this problem?

I'm affraid it's because of maxDate, you have to remove it, same case with yearDropdownItemNumber, it doesn't adjust the height using scroll option. If you remove that prop, it centers, but it's not a solution, but a clue for solving this issue.

turkus avatar Sep 14 '22 14:09 turkus

Hello!) We solved this problem seems together with @AbilityMaster in PR - #3844

SashaRepin2 avatar Dec 03 '22 22:12 SashaRepin2