Skip to content

Set first enabled day to tabindex="0"  #798

@timarney

Description

@timarney

Wondering if you would accept a PR to alter the code below for Day to accept a prop to select a specific date vs defaulting to the first day of the month (tabIndex 0).

let tabIndex = -1;
    // Focus on the first day of the month
    if (this.props.onDayClick && !isOutside && day.getDate() === 1 
      // default to 1 but allow a prop to override
) {
      tabIndex = this.props.tabIndex; // eslint-disable-line prefer-destructuring
}

In most cases the first day makes sense but, I have a use case where a month can have many disabled days. Users navigating with a screen reader end up navigating a lot of disabled days before finding an enabled date. In which case I would like to be able to set the first enabled day to tabIndex 0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions