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

[HOLD for payment 2023-03-06] [HOLD for payment 2023-02-10] [$1000] Timezone changes to some 1st option in the list while pressing the enter key #14314

Closed
1 task
kavimuru opened this issue Jan 14, 2023 · 92 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@kavimuru
Copy link

kavimuru commented Jan 14, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Go to new.expensify.com
  2. Login with any account
  3. Go to Profile and click on timezone
  4. Change timezone to some other regions and go back
  5. Again click on timezone and now hit the enter key
  6. Notice that timezone changes to some other region on pressing the enter key (This doesn’t happen on android/ios while pressing enter on the keyboard. It just happens on web)

Expected Result:

When showing the timezone list the timezone that was set should be selected and visible and pressing the enter key should select the current selected timezone (in case no interaction from the user was made then nothing should change)

Actual Result:

When opening the timezone selection the actual set timezone does not apperar selected, and when pressing enter the first item on the list is seleced instead.

Workaround:

unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • MacOS / Chrome / Safari

Version Number: 1.2.54-2
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos:

timezone.mp4
Recording.1293.mp4

Expensify/Expensify Issue URL:
Issue reported by: @priya-zha
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1673705115960529

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01faba6d65b765cfed
  • Upwork Job ID: 1615516451621584896
  • Last Price Increase: 2023-01-18
@kavimuru kavimuru added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jan 14, 2023
@melvin-bot melvin-bot bot locked and limited conversation to collaborators Jan 14, 2023
@kadiealexander
Copy link
Contributor

Bug0 Triage Checklist

Note: see this SO for more information.

  • The "bug" is actually a bug
  • The bug is not a duplicate report of an existing GH.
    • If it is, close the GH and add any novel details to the original GH instead
  • The bug is reproducible, following the reproduction steps.
    • If the GH doesn’t have steps to reliably reproduce the bug and you figure it out, then please add them.
    • If you’re unable to reproduce the bug, add the Needs reproduction label.
    • Comment on the issue outlining the steps you took to try to reproduce the bug, your results and tag the issue reporter and the Applause QA member who created the issue. Ask them to clarify reproduction steps and/or to check the reproduction steps again. Close issue.
  • The GH template is filled out as fully as possible
    • The GH body and title are clear (ie. could an external contributor understand it and work on it?)
  • The GH was created by an Expensify employee or a QA tester
  • If the bug is an OldDot issue, you should decide whether it is widespread enough to justify fixing or it is better to wait for reunification. If it’s better to wait, close the GH & provide this justification
  • If there's a link to Slack, check the discussion to see if we decided not to fix it
  • Decide if the GH should be resolved by an External contributor or Internal engineer, add the appropriate label

Reproducible, timezone selects the first option in the list when hitting enter, even when a different timezone is written in the text box:

2023-01-18_14-02-26.mp4

@kadiealexander kadiealexander added the External Added to denote the issue can be worked on by a contributor label Jan 18, 2023
@melvin-bot melvin-bot bot unlocked this conversation Jan 18, 2023
@melvin-bot melvin-bot bot changed the title Timezone changes to some 1st option in the list while pressing the enter key [$1000] Timezone changes to some 1st option in the list while pressing the enter key Jan 18, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jan 18, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01faba6d65b765cfed

@melvin-bot
Copy link

melvin-bot bot commented Jan 18, 2023

Current assignee @kadiealexander is eligible for the External assigner, not assigning anyone new.

@melvin-bot
Copy link

melvin-bot bot commented Jan 18, 2023

Triggered auto assignment to Contributor-plus team member for initial proposal review - @rushatgabhane (External)

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jan 18, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jan 18, 2023

Triggered auto assignment to @sketchydroide (External), see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@tienifr
Copy link
Contributor

tienifr commented Jan 18, 2023

Proposal

This happens due to we're focusing on the first element always upon rendering the OptionList, and when we press enter it will select the currently focused element. To fix this we need to focus on the currently selected element, if an element was selected prior to rendering the OptionList

diff --git a/src/components/OptionsSelector/BaseOptionsSelector.js b/src/components/OptionsSelector/BaseOptionsSelector.js
index c473c426d8..b1d5e01957 100755
--- a/src/components/OptionsSelector/BaseOptionsSelector.js
+++ b/src/components/OptionsSelector/BaseOptionsSelector.js
@@ -39,9 +39,17 @@ class BaseOptionsSelector extends Component {
         this.relatedTarget = null;
 
         const allOptions = this.flattenSections();
+
+        const selectedOptionIndex = _.findIndex(allOptions, option => option.text === this.props.value);
+
+        let focusedIndex = this.props.shouldTextInputAppearBelowOptions ? allOptions.length : 0;
+        if (selectedOptionIndex >= 0) {
+            focusedIndex = selectedOptionIndex;
+        }
+
         this.state = {
             allOptions,
-            focusedIndex: this.props.shouldTextInputAppearBelowOptions ? allOptions.length : 0,
+            focusedIndex,
         };
     }
 
diff --git a/src/pages/settings/Profile/TimezoneSelectPage.js b/src/pages/settings/Profile/TimezoneSelectPage.js
index 7a89ac8ce7..7fc47ee5e8 100644
--- a/src/pages/settings/Profile/TimezoneSelectPage.js
+++ b/src/pages/settings/Profile/TimezoneSelectPage.js
@@ -61,6 +61,9 @@ class TimezoneSelectPage extends Component {
      */
     saveSelectedTimezone({text}) {
         PersonalDetails.updateSelectedTimezone(text);
+        this.setState({
+            timezoneInputText: text,
+        });
     }
 
     /**

I'm using the option.text as the criteria to identify the selected option, but we might consider using other sorts of id (like keyForList) if we think it's more precise.

We might need to fix this in other places as well with the same update

@tienifr
Copy link
Contributor

tienifr commented Jan 18, 2023

Proposal 2

If we don't want it to affect anything else, then can introduce a new params in the BaseOptionsSelector to check for the focused index rather than using the props.value

diff --git a/src/components/OptionsSelector/BaseOptionsSelector.js b/src/components/OptionsSelector/BaseOptionsSelector.js
index c473c426d8..b8d32c0015 100755
--- a/src/components/OptionsSelector/BaseOptionsSelector.js
+++ b/src/components/OptionsSelector/BaseOptionsSelector.js
@@ -39,9 +39,18 @@ class BaseOptionsSelector extends Component {
         this.relatedTarget = null;
 
         const allOptions = this.flattenSections();
+
+        let focusedIndex = this.props.shouldTextInputAppearBelowOptions ? allOptions.length : 0;
+
+        const focusedOptionIndex = _.findIndex(allOptions, option => option.text === this.props.focusedValue);
+
+        if (focusedOptionIndex >= 0) {
+            focusedIndex = focusedOptionIndex;
+        }
+
         this.state = {
             allOptions,
-            focusedIndex: this.props.shouldTextInputAppearBelowOptions ? allOptions.length : 0,
+            focusedIndex,
         };
     }
 
diff --git a/src/components/OptionsSelector/optionsSelectorPropTypes.js b/src/components/OptionsSelector/optionsSelectorPropTypes.js
index 306b89a26e..31150e7113 100644
--- a/src/components/OptionsSelector/optionsSelectorPropTypes.js
+++ b/src/components/OptionsSelector/optionsSelectorPropTypes.js
@@ -27,6 +27,9 @@ const propTypes = {
     /** Value in the search input field */
     value: PropTypes.string.isRequired,
 
+    /** Value of the option that we should focused on when first opening the options page */
+    focusedValue: PropTypes.string,
+
     /** Callback fired when text changes */
     onChangeText: PropTypes.func.isRequired,
 
diff --git a/src/pages/settings/Profile/TimezoneSelectPage.js b/src/pages/settings/Profile/TimezoneSelectPage.js
index 7a89ac8ce7..c392057ec0 100644
--- a/src/pages/settings/Profile/TimezoneSelectPage.js
+++ b/src/pages/settings/Profile/TimezoneSelectPage.js
@@ -61,6 +61,9 @@ class TimezoneSelectPage extends Component {
      */
     saveSelectedTimezone({text}) {
         PersonalDetails.updateSelectedTimezone(text);
+        this.setState({
+            timezoneInputText: text,
+        });
     }
 
     /**
@@ -90,6 +93,7 @@ class TimezoneSelectPage extends Component {
                     optionHoveredStyle={styles.hoveredComponentBG}
                     sections={[{data: this.state.timezoneOptions}]}
                     shouldHaveOptionSeparator
+                    focusedValue={this.state.timezoneInputText}
                 />
             </ScreenWrapper>
         );

@tienifr
Copy link
Contributor

tienifr commented Jan 18, 2023

Working well after both proposals:

Screen.Recording.2023-01-18.at.09.21.50.mov

@bernhardoj
Copy link
Contributor

Proposal

If we set the focusedIndex based on previous selection, when we press arrow up/down, it will jump to the previous selected item. I think what we need to do here is to show that the first item is the focused item, like the other list. At timezone selection page, we forget to pass the indexOffset to the sections making the option item focus style didn't show.

diff --git a/src/pages/settings/Profile/TimezoneSelectPage.js b/src/pages/settings/Profile/TimezoneSelectPage.js
index 7a89ac8ce7..f3d4a229c3 100644
--- a/src/pages/settings/Profile/TimezoneSelectPage.js
+++ b/src/pages/settings/Profile/TimezoneSelectPage.js
@@ -88,7 +88,7 @@ class TimezoneSelectPage extends Component {
                     onChangeText={this.filterShownTimezones}
                     onSelectRow={this.saveSelectedTimezone}
                     optionHoveredStyle={styles.hoveredComponentBG}
-                    sections={[{data: this.state.timezoneOptions}]}
+                    sections={[{data: this.state.timezoneOptions, indexOffset: 0}]}
                     shouldHaveOptionSeparator
                 />
             </ScreenWrapper>

Result

Screen.Recording.2023-01-17.at.18.52.19.mov

@tienifr
Copy link
Contributor

tienifr commented Jan 18, 2023

when we press arrow up/down, it will jump to the previous selected item

If we want to avoid this minor issue, then we can default scroll to the selected element when we open the list (in componentDidMount). animated: false can also be added if we want it to snap into the position rather than scrolling into it.

diff --git a/src/components/OptionsSelector/BaseOptionsSelector.js b/src/components/OptionsSelector/BaseOptionsSelector.js
index c473c426d8..60b53f294c 100755
--- a/src/components/OptionsSelector/BaseOptionsSelector.js
+++ b/src/components/OptionsSelector/BaseOptionsSelector.js
@@ -93,6 +103,8 @@ class BaseOptionsSelector extends Component {
         } else {
             this.textInput.focus();
         }
+
+        this.scrollToIndex(this.state.focusedIndex);
     }

I've tested the timezone selection on Slack and these are consistent with Slack's behavior:

  • When on the timezone list and press enter, the selected timezone should stay the same (rather than selecting the 1st timezone)
  • When opening the timezone list for the first time, the selected timezone will show on the screen. We do not need to scroll to view the selected timezone.

Screenshot 2023-01-18 at 10 46 39

Think of the user's viewpoint, if he changes the timezone it's likely will be surrounding timezone in Asia for example, he might not want to scroll all the way just to see the Asia timezone, it should appear by default.

@tienifr
Copy link
Contributor

tienifr commented Jan 18, 2023

There is another place that is also having this problem which may also need to be fixed

Screen.Recording.2023-01-18.at.10.39.51.mov

@s77rt
Copy link
Contributor

s77rt commented Jan 18, 2023

I think pressing enter should select the 1st option, that's the expected behaviour not a bug. The bug is that from the user perspective this is confusing because we are missing the focus state indication on the current focused row. I think all what we need to do here is apply @bernhardoj proposal here

@sketchydroide
Copy link
Contributor

sketchydroide commented Jan 19, 2023

The bug is that the selection is not visible, but I will go a bit further.
I think it's expected that when you press enter it should be the one that is selected already that is again set as the value.
Now I also think that the selected item should be the one that is already set.
I think that is the actual bug. When going to the list of timezones the current timezone should be selected and visible in the list.
And when you press enter nothing happens, as it's already selected.

Example:

  • The user goes and scrolls and Selects GMT;
  • The user is sent back to the chats;
  • The user goes again and goes to the time zones;
  • GMT is selected and visible in the list (aka the list is scrolled to show GMT)
  • Pressing enter does "nothing" as it just selects GMT again

@s77rt
Copy link
Contributor

s77rt commented Jan 19, 2023

Proposal

diff --git a/src/components/OptionsSelector/BaseOptionsSelector.js b/src/components/OptionsSelector/BaseOptionsSelector.js
index c473c426d8..904de0450d 100755
--- a/src/components/OptionsSelector/BaseOptionsSelector.js
+++ b/src/components/OptionsSelector/BaseOptionsSelector.js
@@ -41,7 +41,7 @@ class BaseOptionsSelector extends Component {
         const allOptions = this.flattenSections();
         this.state = {
             allOptions,
-            focusedIndex: this.props.shouldTextInputAppearBelowOptions ? allOptions.length : 0,
+            focusedIndex: props.shouldTextInputAppearBelowOptions ? allOptions.length : 0,
         };
     }
 
@@ -84,6 +84,10 @@ class BaseOptionsSelector extends Component {
             true,
         );
 
+        if (this.props.focusedItemKey) {
+            this.updateFocusedIndex(_.findIndex(this.state.allOptions, option => option.keyForList === this.props.focusedItemKey), false);
+        }
+
         if (!this.props.autoFocus) {
             return;
         }
@@ -166,17 +170,19 @@ class BaseOptionsSelector extends Component {
 
     /**
      * @param {Number} index
+     * @param {Boolean} animated
      */
-    updateFocusedIndex(index) {
-        this.setState({focusedIndex: index}, () => this.scrollToIndex(index));
+    updateFocusedIndex(index, animated = true) {
+        this.setState({focusedIndex: index}, () => this.scrollToIndex(index, animated));
     }
 
     /**
      * Scrolls to the focused index within the SectionList
      *
      * @param {Number} index
+     * @param {Boolean} animated
      */
-    scrollToIndex(index) {
+    scrollToIndex(index, animated = true) {
         const option = this.state.allOptions[index];
         if (!this.list || !option) {
             return;
@@ -195,7 +201,7 @@ class BaseOptionsSelector extends Component {
             }
         }
 
-        this.list.scrollToLocation({sectionIndex: adjustedSectionIndex, itemIndex});
+        this.list.scrollToLocation({sectionIndex: adjustedSectionIndex, itemIndex, animated});
     }
 
     /**
diff --git a/src/components/OptionsSelector/optionsSelectorPropTypes.js b/src/components/OptionsSelector/optionsSelectorPropTypes.js
index 306b89a26e..51691fb41e 100644
--- a/src/components/OptionsSelector/optionsSelectorPropTypes.js
+++ b/src/components/OptionsSelector/optionsSelectorPropTypes.js
@@ -89,6 +89,9 @@ const propTypes = {
 
     /** Whether to show a line separating options in list */
     shouldHaveOptionSeparator: PropTypes.bool,
+
+    /** Initially focused item key */
+    focusedItemKey: PropTypes.string,
 };
 
 const defaultProps = {
@@ -113,6 +116,7 @@ const defaultProps = {
     disableArrowKeysActions: false,
     isDisabled: false,
     shouldHaveOptionSeparator: false,
+    focusedItemKey: '',
 };
 
 export {propTypes, defaultProps};
diff --git a/src/pages/settings/Profile/TimezoneSelectPage.js b/src/pages/settings/Profile/TimezoneSelectPage.js
index 7a89ac8ce7..2018ca275a 100644
--- a/src/pages/settings/Profile/TimezoneSelectPage.js
+++ b/src/pages/settings/Profile/TimezoneSelectPage.js
@@ -88,7 +88,8 @@ class TimezoneSelectPage extends Component {
                     onChangeText={this.filterShownTimezones}
                     onSelectRow={this.saveSelectedTimezone}
                     optionHoveredStyle={styles.hoveredComponentBG}
-                    sections={[{data: this.state.timezoneOptions}]}
+                    sections={[{data: this.state.timezoneOptions, indexOffset: 0}]}
+                    focusedItemKey={this.currentSelectedTimezone}
                     shouldHaveOptionSeparator
                 />
             </ScreenWrapper>

RCA

This seems more like a feature request: scroll to selected item

  1. I have added a prop focusedItemKey to initially focus an item based on matching keyForList
  2. Fixed the missing focus (@bernhardoj)

Note: I have only applied this on the timezone page, looks like we can't apply this on the currency selector in an easy way since we don't have a direct access the current selected currency.

Results

Kooha-2023-01-19-18-47-50.mp4

@tienifr
Copy link
Contributor

tienifr commented Jan 20, 2023

@s77rt looks like your proposal has rather similar approach to my proposals in here and here (the addition of ‘animated: false’ was also covered). The use of ‘keyForList’ was also covered here already.

Regarding the missing focus, I think that might be a conscious design decision since we already have the green check mark to indicate the selected option. You can check the Pronouns selection, it also follows the same behavior.

If someone in the team agrees to fix this missing focus, I’d propose to fix in both Timezones and Pronouns as well by adding the ’indexOffset: 0’.

diff --git a/src/pages/settings/Profile/PronounsPage.js b/src/pages/settings/Profile/PronounsPage.js
index 8665187789..5be60769a3 100644
--- a/src/pages/settings/Profile/PronounsPage.js
+++ b/src/pages/settings/Profile/PronounsPage.js
@@ -63,7 +63,7 @@ const PronounsPage = (props) => {
                 {props.translate('pronounsPage.isShownOnProfile')}
             </Text>
             <OptionsList
-                sections={[{data: pronounsList}]}
+                sections={[{data: pronounsList, indexOffset: 0}]}
                 onSelectRow={option => updatePronouns(option.value)}
                 hideSectionHeaders
                 optionHoveredStyle={styles.hoveredComponentBG}
diff --git a/src/pages/settings/Profile/TimezoneSelectPage.js b/src/pages/settings/Profile/TimezoneSelectPage.js
index c392057ec0..6ccffdcd85 100644
--- a/src/pages/settings/Profile/TimezoneSelectPage.js
+++ b/src/pages/settings/Profile/TimezoneSelectPage.js
@@ -91,7 +91,7 @@ class TimezoneSelectPage extends Component {
                     onChangeText={this.filterShownTimezones}
                     onSelectRow={this.saveSelectedTimezone}
                     optionHoveredStyle={styles.hoveredComponentBG}
-                    sections={[{data: this.state.timezoneOptions}]}
+                    sections={[{data: this.state.timezoneOptions, indexOffset: 0}]}
                     shouldHaveOptionSeparator
                     focusedValue={this.state.timezoneInputText}
                 />

The correct behavior agreed here is also missing in Pronouns and will need to be fixed similar to this.

@s77rt
Copy link
Contributor

s77rt commented Jan 20, 2023

@tienifr The proposal may similar but not the same, you didn't provide a complete proposal. We do things a bit different e.g. the way we update the focused index.

@sketchydroide
Copy link
Contributor

sketchydroide commented Jan 20, 2023

@tienifr your proposal does not scroll the list to current set timezone (at least I did not see it on the video)

You can check the Pronouns selection

I think that might be wrong as well, but I might need to ask design, I think it's good UX practice to show the current selected value

@s77rt your seems to work on the video

@Expensify/design What do you thing the behaviour should be here?

@tienifr
Copy link
Contributor

tienifr commented Jan 20, 2023

@sketchydroide the scroll part is in the second part of my proposal here. The video you see was the part before that so it didn't have the scroll. Sorry for the inconvenience

Let me paste the full diff for my existing proposals above for ease of review:
(I've also pushed it to this branch in case you want to pull and try it out)

diff --git a/src/components/OptionsSelector/BaseOptionsSelector.js b/src/components/OptionsSelector/BaseOptionsSelector.js
index c473c426d8..a5a4337d83 100755
--- a/src/components/OptionsSelector/BaseOptionsSelector.js
+++ b/src/components/OptionsSelector/BaseOptionsSelector.js
@@ -39,9 +39,18 @@ class BaseOptionsSelector extends Component {
         this.relatedTarget = null;
 
         const allOptions = this.flattenSections();
+
+        let focusedIndex = this.props.shouldTextInputAppearBelowOptions ? allOptions.length : 0;
+
+        const focusedOptionIndex = _.findIndex(allOptions, option => option.text === this.props.focusedValue);
+
+        if (focusedOptionIndex >= 0) {
+            focusedIndex = focusedOptionIndex;
+        }
+
         this.state = {
             allOptions,
-            focusedIndex: this.props.shouldTextInputAppearBelowOptions ? allOptions.length : 0,
+            focusedIndex,
         };
     }
 
@@ -93,6 +102,8 @@ class BaseOptionsSelector extends Component {
         } else {
             this.textInput.focus();
         }
+
+        this.scrollToIndex(this.state.focusedIndex, false);
     }
 
     componentDidUpdate(prevProps) {
@@ -175,8 +186,9 @@ class BaseOptionsSelector extends Component {
      * Scrolls to the focused index within the SectionList
      *
      * @param {Number} index
+     * @param {Boolean} animated
      */
-    scrollToIndex(index) {
+    scrollToIndex(index, animated = true) {
         const option = this.state.allOptions[index];
         if (!this.list || !option) {
             return;
@@ -195,7 +207,7 @@ class BaseOptionsSelector extends Component {
             }
         }
 
-        this.list.scrollToLocation({sectionIndex: adjustedSectionIndex, itemIndex});
+        this.list.scrollToLocation({sectionIndex: adjustedSectionIndex, itemIndex, animated});
     }
 
     /**
diff --git a/src/components/OptionsSelector/optionsSelectorPropTypes.js b/src/components/OptionsSelector/optionsSelectorPropTypes.js
index 306b89a26e..31150e7113 100644
--- a/src/components/OptionsSelector/optionsSelectorPropTypes.js
+++ b/src/components/OptionsSelector/optionsSelectorPropTypes.js
@@ -27,6 +27,9 @@ const propTypes = {
     /** Value in the search input field */
     value: PropTypes.string.isRequired,
 
+    /** Value of the option that we should focused on when first opening the options page */
+    focusedValue: PropTypes.string,
+
     /** Callback fired when text changes */
     onChangeText: PropTypes.func.isRequired,
 
diff --git a/src/pages/settings/Profile/TimezoneSelectPage.js b/src/pages/settings/Profile/TimezoneSelectPage.js
index 7a89ac8ce7..6ccffdcd85 100644
--- a/src/pages/settings/Profile/TimezoneSelectPage.js
+++ b/src/pages/settings/Profile/TimezoneSelectPage.js
@@ -61,6 +61,9 @@ class TimezoneSelectPage extends Component {
      */
     saveSelectedTimezone({text}) {
         PersonalDetails.updateSelectedTimezone(text);
+        this.setState({
+            timezoneInputText: text,
+        });
     }
 
     /**
@@ -88,8 +91,9 @@ class TimezoneSelectPage extends Component {
                     onChangeText={this.filterShownTimezones}
                     onSelectRow={this.saveSelectedTimezone}
                     optionHoveredStyle={styles.hoveredComponentBG}
-                    sections={[{data: this.state.timezoneOptions}]}
+                    sections={[{data: this.state.timezoneOptions, indexOffset: 0}]}
                     shouldHaveOptionSeparator
+                    focusedValue={this.state.timezoneInputText}
                 />
             </ScreenWrapper>
         );

I'm using the option.text as the criteria to identify the selected option, but we might consider using other sorts of id (like keyForList) if we think it's more precise.

As mentioned in here we might consider using other sorts of id (like keyForList), but that's an implementation detail.

After the fix

Screen.Recording.2023-01-20.at.18.20.10.mov

@sketchydroide
Copy link
Contributor

@rushatgabhane what do you think?
Both @tienifr and @s77rt approaches are very similar

@shawnborton
Copy link
Contributor

I like the idea of showing the selected item in the center of the view, aka scrolling to the right position when navigating back to the view with these selection lists (pronoun, currency, timezone, etc). However, I don't like how in this proposal here that the view seems to be moving a bit as it comes into view.

cc @Beamanator too since I think you worked on implementing this?

@MelvinBot
Copy link

@sketchydroide, @rushatgabhane, @kadiealexander, @tienifr Whoops! This issue is 2 days overdue. Let's get this updated quick!

@Beamanator
Copy link
Contributor

@thienlnam do you want to take over this issue?

@tienifr
Copy link
Contributor

tienifr commented Feb 21, 2023

@Beamanator The PR is created again and it is being reviewed by @rushatgabhane

@Beamanator
Copy link
Contributor

@tienifr thanks, looks like you're talking about #14938?

I think @thienlnam or I can take over from the expensify side

@tienifr
Copy link
Contributor

tienifr commented Feb 21, 2023

thanks, looks like you're talking about #14938?

@Beamanator yes

I think we can just speed up reviewing that PR, it has the same changes as the one approved and merged previously. It didn't cause the regression but was reverted by mistake.

The regression tests for the related issues were already added as well.

cc @rushatgabhane @thienlnam

@thienlnam
Copy link
Contributor

@Beamanator Yeah, I can take over this issue

@thienlnam thienlnam assigned thienlnam and unassigned sketchydroide Feb 21, 2023
@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Feb 27, 2023
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2023-02-10] [$1000] Timezone changes to some 1st option in the list while pressing the enter key [HOLD for payment 2023-03-06] [HOLD for payment 2023-02-10] [$1000] Timezone changes to some 1st option in the list while pressing the enter key Feb 27, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Feb 27, 2023
@MelvinBot
Copy link

Reviewing label has been removed, please complete the "BugZero Checklist".

@MelvinBot
Copy link

MelvinBot commented Feb 27, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.2.76-7 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2023-03-06. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@MelvinBot
Copy link

MelvinBot commented Feb 27, 2023

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@rushatgabhane / @thienlnam] The PR that introduced the bug has been identified. Link to the PR:
  • [@rushatgabhane / @thienlnam] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@rushatgabhane / @thienlnam] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@tienifr] Propose regression test steps to ensure the same bug will not reach production again.
  • [@kadiealexander] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@tienifr
Copy link
Contributor

tienifr commented Feb 28, 2023

I created regression test before

Regression Test Proposal

Bug: Timezone changes to some 1st option in the list while pressing the enter key

Proposed Test Steps:

  1. Go to Profile and click on timezone
  2. Change timezone to some other regions and go back
  3. Again click on timezone and now hit the enter key
  4. Notice that timezone changes to some other region on pressing the enter key

Do we 👍 or 👎

Video (Regression Test):

Screen.Recording.2023-02-13.at.15.48.56.mp4

@kadiealexander
Copy link
Contributor

@priya-zha, @tienifr and @rushatgabhane please apply here so we can get you paid :)

@priya-zha
Copy link

priya-zha commented Mar 9, 2023

@kadiealexander Upwork doesn't allow me to apply for this job. I get an error even though I'm logged in with the right account.

Screenshot from 2023-03-09 09-02-20

@MelvinBot
Copy link

📣 @priya-zha! 📣

Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  2. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  3. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.

Screen Shot 2022-11-16 at 4 42 54 PM

Format:

Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@kadiealexander
Copy link
Contributor

@priya-zha could you please complete the steps above first?

@priya-zha
Copy link

Contributor details
Your Expensify account email: pj35134@gmail.com
Upwork Profile Link:https://www.upwork.com/freelancers/~011e32317dbbd489e0

@kadiealexander
Copy link
Contributor

Thanks @priya-zha! I have sent you a contract in Upwork, please accept and we'll issue payment.

@priya-zha
Copy link

@kadiealexander Thank you. I've accepted the offer.

@kadiealexander
Copy link
Contributor

kadiealexander commented Mar 9, 2023

Awesome, all paid! Payment issued to @tienifr too. Just waiting for @rushatgabhane to accept. All paid!

@thienlnam are you happy with the regression test proposed here?

@thienlnam
Copy link
Contributor

Sorry for the delay on this - could we please try to be more specific in the regression tests so it's easier for our QA team to follow? @tienifr

Things like updating this

Change timezone to some other regions and go back

to:
Make sure the 'Automatically determine your location' toggle is turned off so you can update your timezone manually
Update the timezone to a random region and then go back to the profile page

Also, we want to test the success case so :

Notice that timezone changes to some other region on pressing the enter key

We don't want this to happen right? So

Verify that the timezone does not change to another region after pressing the enter key

@tienifr
Copy link
Contributor

tienifr commented Mar 9, 2023

@thienlnam Thanks for your comments

Regression Test Proposal

Bug: Timezone changes to some 1st option in the list while pressing the enter key

Proposed Test Steps:

  1. Go to Profile and click on timezone
  2. Ensure that you have disabled the 'Automatically determine your location' option so that you can manually adjust your timezone.
  3. Change the timezone to a different location and then return to the profile page.
  4. Click again on timezone and now hit the enter key
  5. Verify that the timezone does not change to another region after pressing the enter key
    Do we 👍 or 👎

Video (Regression Test):

Screen.Recording.2023-02-13.at.15.48.56.mp4

@thienlnam
Copy link
Contributor

Awesome, looks great now - thanks!

@kadiealexander
Copy link
Contributor

#15940 - GH to get regression test added to TestFlight. @thienlnam is there anything else pending before we close this out?

@thienlnam
Copy link
Contributor

All good here, thanks @kadiealexander !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Weekly KSv2
Projects
None yet
Development

No branches or pull requests