From aad831981abfd17dcfcfb553389deb3b062fee51 Mon Sep 17 00:00:00 2001 From: daraksha Date: Thu, 16 Feb 2023 02:36:08 +0530 Subject: [PATCH] Use shouldDelayFocus --- src/components/RoomNameInput/index.native.js | 1 + src/components/RoomNameInput/roomNameInputPropTypes.js | 4 ++++ src/pages/workspace/WorkspaceNewRoomPage.js | 2 ++ 3 files changed, 7 insertions(+) diff --git a/src/components/RoomNameInput/index.native.js b/src/components/RoomNameInput/index.native.js index a2af6fbbf049..f261b76bafcc 100644 --- a/src/components/RoomNameInput/index.native.js +++ b/src/components/RoomNameInput/index.native.js @@ -46,6 +46,7 @@ class RoomNameInput extends Component { onBlur={this.props.onBlur} autoFocus={this.props.autoFocus} autoCapitalize="none" + shouldDelayFocus={this.props.shouldDelayFocus} /> ); } diff --git a/src/components/RoomNameInput/roomNameInputPropTypes.js b/src/components/RoomNameInput/roomNameInputPropTypes.js index 53666a6ae694..2f4af1ae2e92 100644 --- a/src/components/RoomNameInput/roomNameInputPropTypes.js +++ b/src/components/RoomNameInput/roomNameInputPropTypes.js @@ -27,6 +27,9 @@ const propTypes = { /** AutoFocus */ autoFocus: PropTypes.bool, + + /** Whether we should wait before focusing the TextInput, useful when using transitions on Android */ + shouldDelayFocus: PropTypes.bool, }; const defaultProps = { @@ -39,6 +42,7 @@ const defaultProps = { inputID: undefined, onBlur: () => {}, autoFocus: false, + shouldDelayFocus: false, }; export {propTypes, defaultProps}; diff --git a/src/pages/workspace/WorkspaceNewRoomPage.js b/src/pages/workspace/WorkspaceNewRoomPage.js index f524e34b48c7..0cc96e7ce33a 100644 --- a/src/pages/workspace/WorkspaceNewRoomPage.js +++ b/src/pages/workspace/WorkspaceNewRoomPage.js @@ -19,6 +19,7 @@ import Permissions from '../../libs/Permissions'; import Log from '../../libs/Log'; import * as ValidationUtils from '../../libs/ValidationUtils'; import Form from '../../components/Form'; +import shouldDelayFocus from '../../libs/shouldDelayFocus'; const propTypes = { /** All reports shared with the user */ @@ -141,6 +142,7 @@ class WorkspaceNewRoomPage extends React.Component {