|
| 1 | +# Application Considerations |
| 2 | + |
| 3 | +There are a few application considerations |
| 4 | + |
| 5 | +## Optional feature: application template wrapper |
| 6 | + |
| 7 | +If you are using the [application template wrapper](https://emberjs.com/blog/2018/02/16/ember-3-1-beta-released.html#toc_new-optional-feature-application-template-wrapper) enabled (default state), then you will need to add certain aria roles to your [landmark regions](https://www.w3.org/WAI/PF/aria/roles#landmark_roles), even if you are using native HTML elements, because those regions are not the direct child descendant of the body element (they are the children of the div that wraps the Ember app). |
| 8 | + |
| 9 | +If you disable the [application template wrapper](https://emberjs.com/blog/2018/02/16/ember-3-1-beta-released.html#toc_new-optional-feature-application-template-wrapper), you will not need to add role attributes to your landmark regions when they are the direct descendant of the body element, and they are using native HTML elements. This is the preferred approach for accessible applications. |
| 10 | + |
| 11 | +To disable this feature: |
| 12 | + |
| 13 | +```bash |
| 14 | +ember feature:disable application-template-wrapper |
| 15 | +``` |
| 16 | + |
| 17 | +**Application Template Wrapper Disabled** _(preferred)_ |
| 18 | + |
| 19 | +```hbs |
| 20 | +<body> |
| 21 | + <header></header> |
| 22 | + <main></main> |
| 23 | + <footer></footer> |
| 24 | +</body> |
| 25 | +``` |
| 26 | + |
| 27 | +**Application Template Wrapper Enabled** |
| 28 | + |
| 29 | +```hbs |
| 30 | +<body> |
| 31 | + <div class="ember-view"> |
| 32 | + <header role="banner"></header> |
| 33 | + <main role="main"></main> |
| 34 | + <footer role="contentinfo"></footer> |
| 35 | + </div> |
| 36 | +</body> |
| 37 | +``` |
| 38 | + |
| 39 | +<div class="cta"> |
| 40 | + <div class="cta-note"> |
| 41 | + <div class="cta-note-body"> |
| 42 | + <div class="cta-note-heading">Zoey says...</div> |
| 43 | + <div class="cta-note-message"> |
| 44 | + To learn more about landmark roles and how to use them: <a href="https://www.w3.org/WAI/PF/aria/roles#landmark_roles">https://www.w3.org/WAI/PF/aria/roles#landmark_roles</a>. Still need more help? Visit the #topic-a11y channel in <a href="https://emberjs.com/community/">the community chat</a>. |
| 45 | + </div> |
| 46 | + </div> |
| 47 | + <img src="/images/mascots/zoey.png" role="presentation" alt=""> |
| 48 | + </div> |
| 49 | +</div> |
| 50 | + |
| 51 | +## Ember applications vs role=''application'' |
| 52 | + |
| 53 | +An important thing to note in this section is this: "application" in Ember development and "application" in landmark roles have two _very_ different meanings. |
| 54 | + |
| 55 | +The <abbr title="too long; didn't read">TL;DR</abbr>? Don't use `role="application"` until you have done your research and know exactly how it is to be used correctly (if at all). There are **very** few use cases where the role of application is appropriate. |
| 56 | + |
| 57 | +Read more about it: [https://a11yproject.com/posts/how-to-use-application-role/](https://a11yproject.com/posts/how-to-use-application-role/) |
| 58 | + |
| 59 | +## Accessibility addons |
| 60 | + |
| 61 | +Any addon that will provide UI elements to the application should be evaluated for accessibility before use. |
| 62 | + |
| 63 | +There are some existing Ember addons that may help you make your app more accessible. Each addon should be evaluated for its own usefulness and merit- you may find in some instances, that it would be better to implement the ideas presented in the addon in your own application. |
| 64 | + |
| 65 | +- [ember-a11y-landmarks](https://github.com/ember-a11y/ember-a11y-landmarks) - Ember addon to help with landmark roles for better accessibility |
| 66 | +- [ember-component-focus](https://github.com/ember-a11y/ember-component-focus) - A mixin for adding methods to your Ember components that help you manage the currently focused element. |
| 67 | +- [ember-gestures](https://github.com/html-next/ember-gestures) - Ember Gestures provides an easy way to use gestures by making it simple to define and use HammerJS managers and recognizers throughout your app. |
| 68 | +- [ember-steps](https://github.com/rwjblue/ember-steps) - Declarative create wizards, tabbed UIs, and more |
| 69 | +- [ember-page-title](https://github.com/tim-evans/ember-page-title) - Page title management for Ember.js Apps |
| 70 | +- [ember-self-focused](https://github.com/linkedin/self-focused/tree/master/packages/ember-self-focused) - Focus on route on transition |
| 71 | +- [ember-keyboard](https://github.com/patience-tema-baron/ember-keyboard) - An Ember.js addon for the painless support of keyboard events |
| 72 | +- [ember-a11y-testing](https://github.com/ember-a11y/ember-a11y-testing) - A suite of accessibility tests that can be run within the Ember testing framework |
| 73 | +- [a11y-announcer](https://github.com/ember-a11y/a11y-announcer) - An accessible ember route change announcer |
| 74 | +- [ember-template-lint](https://github.com/ember-template-lint/ember-template-lint) - linter for Ember templates |
0 commit comments