[MM-22082] - Add focus to server name field in new server modal (#1208)

* [MM-22082] - Add focus to server name field in new server modal

* Add focus for multiple initialisations

* Fix focus issues

Co-authored-by: Nevyana <nevyana@Nevyanas-MacBook-Pro.local>
This commit is contained in:
Nev Angelova
2020-03-13 23:46:30 +01:00
committed by GitHub
parent 097e6180c8
commit 9f6147e120

View File

@@ -138,6 +138,7 @@ export default class NewTeamModal extends React.Component {
className='NewTeamModal'
show={this.props.show}
id='newServerModal'
onEntered={() => this.teamNameInputRef.focus()}
onHide={this.props.onClose}
container={this.props.modalContainer}
restoreFocus={this.props.restoreFocus}
@@ -172,10 +173,13 @@ export default class NewTeamModal extends React.Component {
value={this.state.teamName}
placeholder='Server Name'
onChange={this.handleTeamNameChange}
inputRef={(ref) => {
this.teamNameInputRef = ref;
}}
onClick={(e) => {
e.stopPropagation();
}}
autoFocus={true}
autofocus='true'
/>
<FormControl.Feedback/>
<HelpBlock>{'The name of the server displayed on your desktop app tab bar.'}</HelpBlock>