Skip to content
Snippets Groups Projects
Commit 26431c68 authored by Brian Peiris's avatar Brian Peiris
Browse files

set button types to fix submit-on-enter. also specify tab indicies

parent 90241e9f
No related branches found
No related tags found
No related merge requests found
...@@ -72,13 +72,11 @@ class HubCreatePanel extends Component { ...@@ -72,13 +72,11 @@ class HubCreatePanel extends Component {
})); }));
}; };
setToNextEnvironment = e => { setToNextEnvironment = () => {
e.preventDefault();
this.setToEnvironmentOffset(1); this.setToEnvironmentOffset(1);
}; };
setToPreviousEnvironment = e => { setToPreviousEnvironment = () => {
e.preventDefault();
this.setToEnvironmentOffset(-1); this.setToEnvironmentOffset(-1);
}; };
...@@ -120,9 +118,7 @@ class HubCreatePanel extends Component { ...@@ -120,9 +118,7 @@ class HubCreatePanel extends Component {
<div className="create-panel__form"> <div className="create-panel__form">
<div <div
className="create-panel__form__left-container" className="create-panel__form__left-container"
onClick={e => { onClick={() => {
e.preventDefault();
if (this.state.expanded) { if (this.state.expanded) {
this.shuffle(); this.shuffle();
} else { } else {
...@@ -130,7 +126,7 @@ class HubCreatePanel extends Component { ...@@ -130,7 +126,7 @@ class HubCreatePanel extends Component {
} }
}} }}
> >
<button className="create-panel__form__rotate-button"> <button type="button" tabIndex="3" className="create-panel__form__rotate-button">
{this.state.expanded ? ( {this.state.expanded ? (
<img src="../assets/images/dice_icon.svg" /> <img src="../assets/images/dice_icon.svg" />
) : ( ) : (
...@@ -138,8 +134,8 @@ class HubCreatePanel extends Component { ...@@ -138,8 +134,8 @@ class HubCreatePanel extends Component {
)} )}
</button> </button>
</div> </div>
<div className="create-panel__form__right-container" onClick={this.createHub}> <div className="create-panel__form__right-container">
<button className="create-panel__form__submit-button"> <button type="submit" tabIndex="5" className="create-panel__form__submit-button">
{this.isHubNameValid() ? ( {this.isHubNameValid() ? (
<img src="../assets/images/hub_create_button_enabled.svg" /> <img src="../assets/images/hub_create_button_enabled.svg" />
) : ( ) : (
...@@ -184,6 +180,8 @@ class HubCreatePanel extends Component { ...@@ -184,6 +180,8 @@ class HubCreatePanel extends Component {
<div className="create-panel__form__environment__picker__controls"> <div className="create-panel__form__environment__picker__controls">
<button <button
className="create-panel__form__environment__picker__controls__prev" className="create-panel__form__environment__picker__controls__prev"
type="button"
tabIndex="1"
onClick={this.setToPreviousEnvironment} onClick={this.setToPreviousEnvironment}
> >
<FontAwesomeIcon icon={faAngleLeft} /> <FontAwesomeIcon icon={faAngleLeft} />
...@@ -191,6 +189,8 @@ class HubCreatePanel extends Component { ...@@ -191,6 +189,8 @@ class HubCreatePanel extends Component {
<button <button
className="create-panel__form__environment__picker__controls__next" className="create-panel__form__environment__picker__controls__next"
type="button"
tabIndex="2"
onClick={this.setToNextEnvironment} onClick={this.setToNextEnvironment}
> >
<FontAwesomeIcon icon={faAngleRight} /> <FontAwesomeIcon icon={faAngleRight} />
...@@ -200,6 +200,7 @@ class HubCreatePanel extends Component { ...@@ -200,6 +200,7 @@ class HubCreatePanel extends Component {
</div> </div>
)} )}
<input <input
tabIndex="4"
className={formNameClassNames} className={formNameClassNames}
value={this.state.name} value={this.state.name}
onChange={e => this.setState({ name: e.target.value })} onChange={e => this.setState({ name: e.target.value })}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment