Skip to content

Commit

Permalink
role "option" changed to "button", removed unnecessary "listbox" role (
Browse files Browse the repository at this point in the history
…#2098)

Co-authored-by: DDiaz <daniel.diaz@isobar.com>
  • Loading branch information
dan-diaz and DDiaz committed Mar 25, 2020
1 parent 4ae0ca4 commit c1fdd32
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
17 changes: 9 additions & 8 deletions src/day.jsx
Expand Up @@ -240,14 +240,15 @@ export default class Day extends React.Component {

getAriaLabel = () => {
const {
day,
ariaLabelPrefixWhenEnabled = "Choose",
ariaLabelPrefixWhenDisabled = "Not available"
day,
ariaLabelPrefixWhenEnabled = "Choose",
ariaLabelPrefixWhenDisabled = "Not available"
} = this.props;

const prefix = this.isDisabled() || this.isExcluded()
? ariaLabelPrefixWhenDisabled
: ariaLabelPrefixWhenEnabled;

const prefix =
this.isDisabled() || this.isExcluded()
? ariaLabelPrefixWhenDisabled
: ariaLabelPrefixWhenEnabled;

return `${prefix} ${formatDate(day, "PPPP")}`;
};
Expand All @@ -274,7 +275,7 @@ export default class Day extends React.Component {
onMouseEnter={this.handleMouseEnter}
tabIndex={this.getTabIndex()}
aria-label={this.getAriaLabel()}
role="option"
role="button"
aria-disabled={this.isDisabled()}
>
{this.props.renderDayContents
Expand Down
1 change: 0 additions & 1 deletion src/month.jsx
Expand Up @@ -317,7 +317,6 @@ export default class Month extends React.Component {
<div
className={this.getClassNames()}
onMouseLeave={this.handleMouseLeave}
role="listbox"
aria-label={`${ariaLabelPrefix} ${utils.formatDate(day, "yyyy-MM")}`}
>
{showMonthYearPicker
Expand Down

0 comments on commit c1fdd32

Please sign in to comment.