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

Year dropdown navigation arrows are empty, and scroll issue

Open mpenney99 opened this issue 2 months ago • 1 comments

Describe the bug

The buttons to navigate through previous and next years are empty. The view also focuses on the current year after clicking.

See the example here: https://reactdatepicker.com/#example-year-dropdown

To Reproduce Steps to reproduce the behavior:

  1. Create a DatePicker with showYearDropdown={true}
  2. Click the calendar to open it
  3. Click the down arrow next to the current year
  4. Scroll to the bottom of the dropdown
  5. There is an empty space where the nav button should be
  6. Click the empty space
  7. The view scrolls back to the current year

Expected behavior An arrow or other visual indication should be present.

After clicking the button, the scrollbar should stay where it is so the user doesn't have to scroll to the bottom again.

Screenshots Image

Desktop (please complete the following information):

  • OS: Windows
  • Browser: Chrome, Firefox
  • Version: Chrome - 154.0.8037.58, Firefox - 156.0.1

Additional context Add any other context about the problem here.

mpenney99 avatar Sep 30 '26 15:09 mpenney99

I'm also experiencing this issue, so I really appreciate @tevinch for taking the time to investigate and put together a fix. I'd be glad to see this merged in!

I've checked out his PR locally, and things look good to me. I see the chevrons, and the current year stays in view even after scroll.

Let me know if I can provide any assistance. Thanks!

megbailey avatar Oct 09 '26 18:10 megbailey