Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add shouldDelayFocus for RoomNameInput #15184

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/components/RoomNameInput/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class RoomNameInput extends Component {
onBlur={this.props.onBlur}
autoFocus={this.props.autoFocus}
autoCapitalize="none"
shouldDelayFocus={this.props.shouldDelayFocus}
/>
);
}
Expand Down
4 changes: 4 additions & 0 deletions src/components/RoomNameInput/roomNameInputPropTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -39,6 +42,7 @@ const defaultProps = {
inputID: undefined,
onBlur: () => {},
autoFocus: false,
shouldDelayFocus: false,
};

export {propTypes, defaultProps};
2 changes: 2 additions & 0 deletions src/pages/workspace/WorkspaceNewRoomPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -141,6 +142,7 @@ class WorkspaceNewRoomPage extends React.Component {
<RoomNameInput
inputID="roomName"
autoFocus
shouldDelayFocus={shouldDelayFocus}
/>
</View>
<View style={styles.mb5}>
Expand Down