Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

react-a11y DayPicker warning #386

Closed
reintroducing opened this issue Jun 10, 2017 · 6 comments
Closed

react-a11y DayPicker warning #386

reintroducing opened this issue Jun 10, 2017 · 6 comments
Milestone

Comments

@reintroducing
Copy link

reintroducing commented Jun 10, 2017

I'm working on a project where accessibility is a requirement and I just integrated DayPicker into the fold. I'm using react-a11y to warn me of any possible issues I may run into/omit to make sure I am not forgetting accessibility when developing my components. I'm seeing this pop up now:

DayPicker You have an unlabeled element or control. Add `aria-label` or `aria-labelledby` attribute, or put some text in the element.

I can't for the life of me figure out where its coming from or how to resolve it. I'm not using any fancy implementation of DayPicker, just pretty standard stuff:

<DayPicker
     selectedDays={this._modifierSelected}
     disabledDays={this._modifierDisabled}
     onDayClick={this._onDaySelected}
     fromMonth={fromMonth}
     toMonth={toMonth}
     initialMonth={initialMonth}
     weekdaysShort={this._weekdayTitles}
     navbarElement={<DatePickerCalendarNavigation />}
     enableOutsideDays
 />

Any help would be greatly appreciated.

@gpbl
Copy link
Owner

gpbl commented Jun 10, 2017

Thanks for the report! Which version of react-a11y are you using?

@gpbl gpbl closed this as completed Jun 10, 2017
@gpbl gpbl reopened this Jun 10, 2017
@gpbl gpbl added aria labels Jun 10, 2017
@reintroducing
Copy link
Author

I'm using react-a11y v0.3.3 which seems to be the latest.

@gpbl gpbl added this to the v5.6.0 milestone Jun 12, 2017
gpbl added a commit that referenced this issue Jun 12, 2017
@gpbl
Copy link
Owner

gpbl commented Jun 12, 2017

I've found the reason of this warning: when the days outside the current month are not shown, we are still adding role="gridcell". However:

A gridcell may be focusable, editable, and selectable.

which is clearly not the case – removing the role attribute won't make react-a11y to warn. Thanks for reporting this!

@gpbl gpbl closed this as completed in #394 Jun 12, 2017
@gpbl
Copy link
Owner

gpbl commented Jun 12, 2017

(the fix will be published to the upcoming release)

@gpbl gpbl added the bug label Jun 12, 2017
@reintroducing
Copy link
Author

Great, thanks for the quick turn around, really appreciate your work on this component. It's fantastic and I use it in multiple projects (not all needing this level of accessibility) :).

@gpbl
Copy link
Owner

gpbl commented Jun 17, 2017

Thanks @reintroducing for the nice words! The change has been published in v6.0.0 (changelog) 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants