diff --git a/src/pages/workspace/WorkspaceNewRoomPage.js b/src/pages/workspace/WorkspaceNewRoomPage.js index 898840e0ed7f..654e2ce8cc0f 100644 --- a/src/pages/workspace/WorkspaceNewRoomPage.js +++ b/src/pages/workspace/WorkspaceNewRoomPage.js @@ -56,6 +56,7 @@ class WorkspaceNewRoomPage extends React.Component { }; this.validateAndAddPolicyReport = this.validateAndAddPolicyReport.bind(this); + this.focusRoomNameInput = this.focusRoomNameInput.bind(this); } componentDidMount() { @@ -127,6 +128,14 @@ class WorkspaceNewRoomPage extends React.Component { })); } + focusRoomNameInput() { + if (!this.roomNameInputRef) { + return; + } + + this.roomNameInputRef.focus(); + } + render() { if (!Permissions.canUsePolicyRooms(this.props.betas)) { Log.info('Not showing create Policy Room page since user is not on policy rooms beta'); @@ -141,7 +150,7 @@ class WorkspaceNewRoomPage extends React.Component { })); return ( - + Navigation.dismissModal()} @@ -149,6 +158,7 @@ class WorkspaceNewRoomPage extends React.Component { this.roomNameInputRef = el} policyID={this.state.policyID} errorText={this.state.errors.roomName} onChangeText={roomName => this.clearErrorAndSetValue('roomName', roomName)}