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