diff --git a/src/renderer/components/NewTeamModal.tsx b/src/renderer/components/NewTeamModal.tsx index 75cddaa3..19c1e044 100644 --- a/src/renderer/components/NewTeamModal.tsx +++ b/src/renderer/components/NewTeamModal.tsx @@ -34,7 +34,7 @@ type State = { class NewTeamModal extends React.PureComponent { wasShown?: boolean; - teamNameInputRef?: HTMLInputElement; + teamUrlInputRef?: HTMLInputElement; static defaultProps = { restoreFocus: true, @@ -262,7 +262,7 @@ class NewTeamModal extends React.PureComponent { show={this.props.show} id='newServerModal' enforceFocus={true} - onEntered={() => this.teamNameInputRef?.focus()} + onEntered={() => this.teamUrlInputRef?.focus()} onHide={this.props.onClose} restoreFocus={this.props.restoreFocus} onKeyDown={(e: React.KeyboardEvent) => { @@ -287,41 +287,6 @@ class NewTeamModal extends React.PureComponent {
- - - - { - this.teamNameInputRef = ref; - if (this.props.setInputRef) { - this.props.setInputRef(ref); - } - }} - onClick={(e: React.MouseEvent) => { - e.stopPropagation(); - }} - autoFocus={true} - isInvalid={Boolean(this.getTeamNameValidationState())} - /> - - - - - - { onClick={(e: React.MouseEvent) => { e.stopPropagation(); }} + ref={(ref: HTMLInputElement) => { + this.teamUrlInputRef = ref; + if (this.props.setInputRef) { + this.props.setInputRef(ref); + } + }} isInvalid={Boolean(this.getTeamUrlValidationState())} + autoFocus={true} + /> + + + + + + + + + + ) => { + e.stopPropagation(); + }} + isInvalid={Boolean(this.getTeamNameValidationState())} />