From dfdf1ef356016fe364b4aa49ffb70e89d43d247e Mon Sep 17 00:00:00 2001 From: christianwenifr Date: Wed, 5 Apr 2023 10:21:39 +0700 Subject: [PATCH 1/3] fix: pronounce page focus --- src/components/OptionsList/BaseOptionsList.js | 5 ++++- src/pages/settings/Profile/PronounsPage.js | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/OptionsList/BaseOptionsList.js b/src/components/OptionsList/BaseOptionsList.js index 38f0d7c9be3f..4a770c51cc35 100644 --- a/src/components/OptionsList/BaseOptionsList.js +++ b/src/components/OptionsList/BaseOptionsList.js @@ -158,6 +158,9 @@ class BaseOptionsList extends Component { */ renderItem({item, index, section}) { const isDisabled = this.props.isDisabled || section.isDisabled; + const indexOffset = section.indexOffset || 0; + + console.log('item', item, index, this.props.focusedIndex, index + section.indexOffset); return ( option.login === item.login))} showSelectedState={this.props.canSelectMultipleOptions} diff --git a/src/pages/settings/Profile/PronounsPage.js b/src/pages/settings/Profile/PronounsPage.js index c5f398927b1b..7535db05b2e9 100644 --- a/src/pages/settings/Profile/PronounsPage.js +++ b/src/pages/settings/Profile/PronounsPage.js @@ -125,7 +125,7 @@ class PronounsPage extends Component { textInputLabel={this.props.translate('pronounsPage.pronouns')} placeholderText={this.props.translate('pronounsPage.placeholderText')} headerMessage={headerMessage} - sections={[{data: filteredPronounsList}]} + sections={[{data: filteredPronounsList, indexOffset: 0}]} value={this.state.searchValue} onSelectRow={this.updatePronouns} onChangeText={this.onChangeText} From 4974d7c67b2db29557973611cef9a18285d60bfa Mon Sep 17 00:00:00 2001 From: tienifr Date: Sat, 8 Apr 2023 00:39:30 +0700 Subject: [PATCH 2/3] remove default indexOffset --- src/components/OptionsList/BaseOptionsList.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/components/OptionsList/BaseOptionsList.js b/src/components/OptionsList/BaseOptionsList.js index 4a770c51cc35..854082e18eef 100644 --- a/src/components/OptionsList/BaseOptionsList.js +++ b/src/components/OptionsList/BaseOptionsList.js @@ -158,9 +158,7 @@ class BaseOptionsList extends Component { */ renderItem({item, index, section}) { const isDisabled = this.props.isDisabled || section.isDisabled; - const indexOffset = section.indexOffset || 0; - console.log('item', item, index, this.props.focusedIndex, index + section.indexOffset); return ( option.login === item.login))} showSelectedState={this.props.canSelectMultipleOptions} From c08e4fe8220a90e9b3d7895f0c4322adb2abb6a6 Mon Sep 17 00:00:00 2001 From: tienifr <113963320+tienifr@users.noreply.github.com> Date: Mon, 10 Apr 2023 20:03:12 +0700 Subject: [PATCH 3/3] Update src/components/OptionsList/BaseOptionsList.js Co-authored-by: Luthfi --- src/components/OptionsList/BaseOptionsList.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/OptionsList/BaseOptionsList.js b/src/components/OptionsList/BaseOptionsList.js index 854082e18eef..38f0d7c9be3f 100644 --- a/src/components/OptionsList/BaseOptionsList.js +++ b/src/components/OptionsList/BaseOptionsList.js @@ -158,7 +158,6 @@ class BaseOptionsList extends Component { */ renderItem({item, index, section}) { const isDisabled = this.props.isDisabled || section.isDisabled; - return (