Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Conversation

marcysutton
Copy link
Contributor

When a button, checkbox, radio button or slider is missing alternative text, warnings are logged to the developer telling them about the problem and directing them to the live node requiring a fix.

Closes #342

@marcysutton marcysutton added a11y This issue is related to accessibility type: bug labels Sep 30, 2014
@marcysutton marcysutton changed the title Improving aria-label warnings WIP: Improving aria-label warnings Sep 30, 2014
@ThomasBurleson
Copy link
Contributor

@marcysutton - as part of #340 [Refactor to use ngAria], we need to move these service methods to Utils and not use a custom $aria material service (since it conflicts). This also impacts #314.

@marcysutton
Copy link
Contributor Author

Ok. I figured the service would just be renamed.

@ThomasBurleson
Copy link
Contributor

If we want to use $log, then we need a service. So perhaps just renaming it $materialAria is a good start.

We could even inject the $aria service (from ngAria) and then extend() our own service with ngAria's features.

@marcysutton
Copy link
Contributor Author

@ThomasBurleson any input on the timing issue mentioned above?

@ThomasBurleson
Copy link
Contributor

@marcysutton - can I voip with you tomorrow AM after 11:00 AM CST?
We can discuss the timing issue and solution(s).

@marcysutton marcysutton force-pushed the wip-aria-label-warnings branch 4 times, most recently from e582b55 to 94a233c Compare October 3, 2014 00:30
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding TestUtil.mockRaf here causes the existing tests to fail. But without it, $materialAria.expect does not run.

@marcysutton marcysutton force-pushed the wip-aria-label-warnings branch from 94a233c to 828cb4e Compare October 3, 2014 21:26
@marcysutton marcysutton changed the title WIP: Improving aria-label warnings Improving aria-label warnings Oct 3, 2014
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ajoslin @ThomasBurleson This causes an issue when there is more than one component of the same type on a page: $materialAria.expect only executes for the last instance. Need to figure out a way to delay expectAttribute from running but still execute for every component that needs it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah. right.

Just do:

function expectAttribute() {
  $$rAF(function() {
    //expectAttribute logic
  });
}

@marcysutton marcysutton force-pushed the wip-aria-label-warnings branch 3 times, most recently from bca0431 to bad82be Compare October 8, 2014 22:17
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passing false for copyElementText will accommodate components requiring a warning for aria-label if the developer forgot, such as material-slider. Passing true will try to copy the element's text (or use the optional defaultValue, like in the case of material-dialog). I'm open to renaming this parameter to something that sounds more boolean (or refactoring).

@marcysutton marcysutton force-pushed the wip-aria-label-warnings branch 2 times, most recently from 0615d2b to 2ea9e3f Compare October 14, 2014 17:58
@ajoslin ajoslin force-pushed the master branch 2 times, most recently from 42c80f7 to 4c0c50e Compare October 16, 2014 13:38
@marcysutton marcysutton force-pushed the wip-aria-label-warnings branch from 2ea9e3f to 063e61d Compare October 16, 2014 21:25
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We include ngAria as a dependency of ngMaterial itself now, so this is extraneous.

@marcysutton marcysutton force-pushed the wip-aria-label-warnings branch from a8cef8f to e6363c8 Compare October 17, 2014 23:12
@ajoslin
Copy link
Contributor

ajoslin commented Oct 17, 2014

Merged via 3368c93.

@ajoslin ajoslin closed this Oct 17, 2014
@marcysutton marcysutton deleted the wip-aria-label-warnings branch October 28, 2014 17:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

a11y This issue is related to accessibility

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Buttons without text are inaccessible

3 participants