Skip to content

Week number buttons accessibility issue #5280

@sarates

Description

@sarates

Describe the bug
When using a datepicker with both showWeekPicker and showWeekNumbers enabled, the week number buttons remain interactive (clickable) even if the corresponding weeks are disabled due to excludeDateIntervals or filterDate conditions (days are disabled). This leads to unexpected behavior where users can click on weeks that should not be accessible (week doesn't change, datepicker just closing). All week buttons have react-datepicker__week-number react-datepicker__week-number--clickable class name.

To Reproduce
Steps to reproduce the behavior:

showWeekNumbers
showWeekPicker
excludeDateIntervals={[
  {
     start: moment().subtract(15, 'days').toDate(),
     end: moment().subtract(1, 'days').toDate(),
   },
]}
filterDate={isTimeInTheFuture}

Expected behavior
Week number buttons should be disabled.

Screenshots
Screenshot 2024-12-16 at 12 49 33

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions