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(selection-list): focus input on screen focus #26415

Merged
Merged
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
24 changes: 11 additions & 13 deletions src/pages/settings/Profile/PronounsPage.js
Copy link
Contributor

@huzaifa-99 huzaifa-99 Sep 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just confirming if this change was intentional? @thiagobrez

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @huzaifa-99, yeah it was intentional. The regression came in due to the fact that I wasn't aware that a pronoun could be un-selected. I already sent a comment in the issue

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Original file line number Diff line number Diff line change
Expand Up @@ -70,20 +70,18 @@ function PronounsPage({currentUserPersonalDetails}) {
title={translate('pronounsPage.pronouns')}
onBackButtonPress={() => Navigation.goBack(ROUTES.SETTINGS_PROFILE)}
/>
<Text style={[styles.ph5, styles.mb3]}>{props.translate('pronounsPage.isShownOnProfile')}</Text>
{/* Only render pronouns if list was loaded (not filtered list), otherwise initially focused item will be empty */}
{pronounsList.length > 0 && (
<SelectionList
headerMessage={headerMessage}
textInputLabel={props.translate('pronounsPage.pronouns')}
textInputPlaceholder={props.translate('pronounsPage.placeholderText')}
textInputValue={searchValue}
sections={[{data: filteredPronounsList, indexOffset: 0}]}
onSelectRow={updatePronouns}
onChangeText={onChangeText}
initiallyFocusedOptionKey={initiallyFocusedOption.keyForList}
<Text style={[styles.ph5, styles.mb3]}>{translate('pronounsPage.isShownOnProfile')}</Text>
<SelectionList
headerMessage={headerMessage}
textInputLabel={translate('pronounsPage.pronouns')}
textInputPlaceholder={translate('pronounsPage.placeholderText')}
textInputValue={searchValue}
sections={[{data: filteredPronounsList, indexOffset: 0}]}
onSelectRow={updatePronouns}
onChangeText={setSearchValue}
initiallyFocusedOptionKey={currentPronounsKey}
/>
)}

</ScreenWrapper>
);
}
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.