Skip to content

Commit

Permalink
use auto focus input hook
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardoj committed Dec 18, 2023
1 parent bc62838 commit 08a9677
Showing 1 changed file with 4 additions and 2 deletions.
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

0 comments on commit 08a9677

Please sign in to comment.