summaryrefslogtreecommitdiff
path: root/ui/app/components/wizard/provider_select_stage.js
diff options
context:
space:
mode:
authorSimon Fondrie-Teitler <simonft@riseup.net>2017-04-26 20:28:27 -0400
committerKali Kaneko (leap communications) <kali@leap.se>2017-05-04 16:27:23 +0200
commitaa8cf504f876182048e1f0e5b72b234b10a7f472 (patch)
tree2fc444b7b3c622621bb9f594e7b664eb5293d136 /ui/app/components/wizard/provider_select_stage.js
parenta6437a3f30a8690b5cb0cf9bad2d0e5253743039 (diff)
[feat] Go to first open line when enter is pressed
When filling out the signup or login pages, and when adding an additional service provider, the enter key will trigger the submit action. When on the choose provider page, enter will take you to the next page. - Resolves: #8841
Diffstat (limited to 'ui/app/components/wizard/provider_select_stage.js')
-rw-r--r--ui/app/components/wizard/provider_select_stage.js32
1 files changed, 23 insertions, 9 deletions
diff --git a/ui/app/components/wizard/provider_select_stage.js b/ui/app/components/wizard/provider_select_stage.js
index 2a342d9b..b19fc8ac 100644
--- a/ui/app/components/wizard/provider_select_stage.js
+++ b/ui/app/components/wizard/provider_select_stage.js
@@ -33,12 +33,13 @@ export default class ProviderSelectStage extends React.Component {
provider: null, // Provider object, if selected
error: null // error message
}
- this.add = this.add.bind(this)
- this.remove = this.remove.bind(this)
- this.select = this.select.bind(this)
- this.close = this.close.bind(this)
- this.cancel = this.cancel.bind(this)
- this.next = this.next.bind(this)
+ this.add = this.add.bind(this)
+ this.remove = this.remove.bind(this)
+ this.select = this.select.bind(this)
+ this.close = this.close.bind(this)
+ this.cancel = this.cancel.bind(this)
+ this.next = this.next.bind(this)
+ this.onKeyDown = this.onKeyDown.bind(this)
}
componentWillMount() {
@@ -134,6 +135,13 @@ export default class ProviderSelectStage extends React.Component {
})
}
+ onKeyDown(e) {
+ // Check for enter key
+ if (e.keyCode === 13) {
+ this.next();
+ }
+ }
+
render() {
let modal = null
let info = null
@@ -171,9 +179,15 @@ export default class ProviderSelectStage extends React.Component {
</ButtonToolbar>
</div>
)
- let editlist = <ListEditor ref="list" items={this.state.domains}
- selected={this.state.selected} onRemove={this.remove} onAdd={this.add}
- onSelect={this.select} />
+ let editlist = <ListEditor
+ ref="list"
+ items={this.state.domains}
+ selected={this.state.selected}
+ onRemove={this.remove}
+ onAdd={this.add}
+ onSelect={this.select}
+ onKeyDown={this.onKeyDown}
+ />
return(
<StageLayout title={this.props.title} subtitle={this.props.subtitle} buttons={buttons}>
<HorizontalLayout equalWidths={true}>