FIX: Tab ordering and outlines for wizard

This commit is contained in:
Robin Ward 2016-09-22 13:38:40 -04:00
parent adfa2cb09e
commit 92529cd409
9 changed files with 18 additions and 15 deletions

View File

@ -7,7 +7,7 @@ export default Ember.Component.extend({
typeClass: type => `${Ember.String.dasherize(type)}-field`,
@computed('field.id')
fieldClass: id => `field-${Ember.String.dasherize(id)}`,
fieldClass: id => `field-${Ember.String.dasherize(id)} wizard-focusable`,
@computed('field.type', 'field.id')
inputComponentName(type, id) {

View File

@ -48,8 +48,12 @@ export default Ember.Component.extend({
keyPress(key) {
if (key.keyCode === 13) {
if (this.get('showDoneButton')) {
this.send('quit');
} else {
this.send('nextStep');
}
}
},
@computed('step.index', 'wizard.totalSteps')
@ -63,13 +67,13 @@ export default Ember.Component.extend({
autoFocus() {
Ember.run.scheduleOnce('afterRender', () => {
const $invalid = $('.wizard-field.invalid:eq(0) input');
const $invalid = $('.wizard-field.invalid:eq(0) .wizard-focusable');
if ($invalid.length) {
return $invalid.focus();
}
$('input:eq(0)').focus();
$('.wizard-focusable:eq(0)').focus();
});
},

View File

@ -9,7 +9,7 @@
<div class="new-user">
<div class="text-field {{if invalid 'invalid'}}">
{{input class="invite-email" value=inviteEmail placeholder="user@example.com"}}
{{input class="invite-email wizard-focusable" value=inviteEmail placeholder="user@example.com" tabindex="9"}}
</div>
{{combo-box value=inviteRole content=roles nameProperty="label" width="200px"}}

View File

@ -1,5 +1,5 @@
<div class='radio-area'>
<input type="radio" name={{label}}>
<input type="radio" name={{label}} tabindex="9">
<span class='radio-label'>
{{#if icon}}
{{fa-icon icon}}

View File

@ -3,4 +3,5 @@
value=field.value
content=field.choices
nameProperty="label"
width="400px"}}
width="400px"
tabindex="9"}}

View File

@ -1 +1 @@
{{input elementId=field.id value=field.value class=fieldClass placeholder=field.placeholder}}
{{input elementId=field.id value=field.value class=fieldClass placeholder=field.placeholder tabindex="9"}}

View File

@ -1 +1 @@
{{textarea elementId=field.id value=field.value class=fieldClass placeholder=field.placeholder}}
{{textarea elementId=field.id value=field.value class=fieldClass placeholder=field.placeholder tabindex="9"}}

View File

@ -30,22 +30,22 @@
<div class='wizard-buttons'>
{{#if showQuitButton}}
<a href {{action "quit"}} class='action-link quit'>{{i18n "wizard.quit"}}</a>
<a href {{action "quit"}} class='action-link quit' tabindex="11">{{i18n "wizard.quit"}}</a>
{{/if}}
{{#if showBackButton}}
<a href {{action "backStep"}} class='action-link back'>{{i18n "wizard.back"}}</a>
<a href {{action "backStep"}} class='action-link back' tabindex="11">{{i18n "wizard.back"}}</a>
{{/if}}
{{#if showNextButton}}
<button class='wizard-btn next primary' {{action "nextStep"}} disabled={{saving}}>
<button class='wizard-btn next primary' {{action "nextStep"}} disabled={{saving}} tabindex="10">
{{i18n "wizard.next"}}
{{fa-icon "chevron-right"}}
</button>
{{/if}}
{{#if showDoneButton}}
<button class='wizard-btn done' {{action "quit"}} disabled={{saving}}>
<button class='wizard-btn done' {{action "quit"}} disabled={{saving}} tabindex="10">
{{i18n "wizard.done"}}
</button>
{{/if}}

View File

@ -175,7 +175,6 @@ body.wizard {
font-size: 1.0em;
border: 0px;
padding: 0.5em;
outline: 0;
transition: background-color .3s;
margin-right: 0.5em;
@ -390,7 +389,6 @@ body.wizard {
padding: 6px;
border: 1px solid #ccc;
transition: border-color .5s;
outline: none;
}
&.invalid {