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

Fix status message page doesn't refocus after going back to it #33210

Merged
merged 1 commit into from
Dec 18, 2023
Merged
Changes from all commits
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
6 changes: 4 additions & 2 deletions src/pages/settings/Profile/CustomStatus/StatusPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import ScreenWrapper from '@components/ScreenWrapper';
import Text from '@components/Text';
import TextInput from '@components/TextInput';
import withCurrentUserPersonalDetails, {withCurrentUserPersonalDetailsPropTypes} from '@components/withCurrentUserPersonalDetails';
import useAutoFocusInput from '@hooks/useAutoFocusInput';
import useLocalize from '@hooks/useLocalize';
import useStyleUtils from '@hooks/useStyleUtils';
import useTheme from '@hooks/useTheme';
Expand Down Expand Up @@ -123,6 +124,8 @@ function StatusPage({draftStatus, currentUserPersonalDetails}) {
return {};
}, [brickRoadIndicator]);

const {inputCallbackRef} = useAutoFocusInput();

return (
<ScreenWrapper
style={[StyleUtils.getBackgroundColorStyle(theme.PAGE_THEMES[SCREENS.SETTINGS.PROFILE.STATUS].backgroundColor)]}
Expand Down Expand Up @@ -159,14 +162,13 @@ function StatusPage({draftStatus, currentUserPersonalDetails}) {
/>
<InputWrapper
InputComponent={TextInput}
ref={inputCallbackRef}
inputID={INPUT_IDS.STATUS_TEXT}
role={CONST.ACCESSIBILITY_ROLE.TEXT}
label={translate('statusPage.message')}
accessibilityLabel={INPUT_IDS.STATUS_TEXT}
defaultValue={defaultText}
maxLength={CONST.STATUS_TEXT_MAX_LENGTH}
autoFocus
shouldDelayFocus
/>
</View>
<MenuItemWithTopDescription
Expand Down
Loading