FIX: Tab ordering and outlines for wizard
This commit is contained in:
parent
adfa2cb09e
commit
92529cd409
|
@ -7,7 +7,7 @@ export default Ember.Component.extend({
|
||||||
typeClass: type => `${Ember.String.dasherize(type)}-field`,
|
typeClass: type => `${Ember.String.dasherize(type)}-field`,
|
||||||
|
|
||||||
@computed('field.id')
|
@computed('field.id')
|
||||||
fieldClass: id => `field-${Ember.String.dasherize(id)}`,
|
fieldClass: id => `field-${Ember.String.dasherize(id)} wizard-focusable`,
|
||||||
|
|
||||||
@computed('field.type', 'field.id')
|
@computed('field.type', 'field.id')
|
||||||
inputComponentName(type, id) {
|
inputComponentName(type, id) {
|
||||||
|
|
|
@ -48,8 +48,12 @@ export default Ember.Component.extend({
|
||||||
|
|
||||||
keyPress(key) {
|
keyPress(key) {
|
||||||
if (key.keyCode === 13) {
|
if (key.keyCode === 13) {
|
||||||
|
if (this.get('showDoneButton')) {
|
||||||
|
this.send('quit');
|
||||||
|
} else {
|
||||||
this.send('nextStep');
|
this.send('nextStep');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@computed('step.index', 'wizard.totalSteps')
|
@computed('step.index', 'wizard.totalSteps')
|
||||||
|
@ -63,13 +67,13 @@ export default Ember.Component.extend({
|
||||||
|
|
||||||
autoFocus() {
|
autoFocus() {
|
||||||
Ember.run.scheduleOnce('afterRender', () => {
|
Ember.run.scheduleOnce('afterRender', () => {
|
||||||
const $invalid = $('.wizard-field.invalid:eq(0) input');
|
const $invalid = $('.wizard-field.invalid:eq(0) .wizard-focusable');
|
||||||
|
|
||||||
if ($invalid.length) {
|
if ($invalid.length) {
|
||||||
return $invalid.focus();
|
return $invalid.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
$('input:eq(0)').focus();
|
$('.wizard-focusable:eq(0)').focus();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
<div class="new-user">
|
<div class="new-user">
|
||||||
<div class="text-field {{if invalid 'invalid'}}">
|
<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>
|
</div>
|
||||||
|
|
||||||
{{combo-box value=inviteRole content=roles nameProperty="label" width="200px"}}
|
{{combo-box value=inviteRole content=roles nameProperty="label" width="200px"}}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<div class='radio-area'>
|
<div class='radio-area'>
|
||||||
<input type="radio" name={{label}}>
|
<input type="radio" name={{label}} tabindex="9">
|
||||||
<span class='radio-label'>
|
<span class='radio-label'>
|
||||||
{{#if icon}}
|
{{#if icon}}
|
||||||
{{fa-icon icon}}
|
{{fa-icon icon}}
|
||||||
|
|
|
@ -3,4 +3,5 @@
|
||||||
value=field.value
|
value=field.value
|
||||||
content=field.choices
|
content=field.choices
|
||||||
nameProperty="label"
|
nameProperty="label"
|
||||||
width="400px"}}
|
width="400px"
|
||||||
|
tabindex="9"}}
|
||||||
|
|
|
@ -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"}}
|
||||||
|
|
|
@ -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"}}
|
||||||
|
|
|
@ -30,22 +30,22 @@
|
||||||
|
|
||||||
<div class='wizard-buttons'>
|
<div class='wizard-buttons'>
|
||||||
{{#if showQuitButton}}
|
{{#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}}
|
||||||
|
|
||||||
{{#if showBackButton}}
|
{{#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}}
|
||||||
|
|
||||||
{{#if showNextButton}}
|
{{#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"}}
|
{{i18n "wizard.next"}}
|
||||||
{{fa-icon "chevron-right"}}
|
{{fa-icon "chevron-right"}}
|
||||||
</button>
|
</button>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{#if showDoneButton}}
|
{{#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"}}
|
{{i18n "wizard.done"}}
|
||||||
</button>
|
</button>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
|
@ -175,7 +175,6 @@ body.wizard {
|
||||||
font-size: 1.0em;
|
font-size: 1.0em;
|
||||||
border: 0px;
|
border: 0px;
|
||||||
padding: 0.5em;
|
padding: 0.5em;
|
||||||
outline: 0;
|
|
||||||
transition: background-color .3s;
|
transition: background-color .3s;
|
||||||
margin-right: 0.5em;
|
margin-right: 0.5em;
|
||||||
|
|
||||||
|
@ -390,7 +389,6 @@ body.wizard {
|
||||||
padding: 6px;
|
padding: 6px;
|
||||||
border: 1px solid #ccc;
|
border: 1px solid #ccc;
|
||||||
transition: border-color .5s;
|
transition: border-color .5s;
|
||||||
outline: none;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&.invalid {
|
&.invalid {
|
||||||
|
|
Loading…
Reference in New Issue