Hacker0x01 / react-datepicker

A simple and reusable datepicker component for React

Home Page:https://reactdatepicker.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Multiple options with the same aria-label

francescovenica opened this issue · comments

Describe the bug

When using range and 2 month the left month contains a few day of the next month (1st,2nd,3rd, and other based on the month), this create issues when testing (and probably with screen reader) as doing something like:

await page.getByLabel(`Choose ${todayPlusMonthFormatted}`, { exact: true }).click();

will fail because it find 2 options.

Here a codesendbox

Expected behavior
The hidden option shouldn't have the aria-label or should be disabled

Screenshots

Screenshot 2024-04-11 at 08 19 40