Timezone - Dropdown is selectable when the "Set my time zone" bottom checkbox is checked
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Expected Result:
Dropdown should be disabled if the bottom checkbox is checked
Actual Result:
Dropdown is selectable when the "Set my time zone" bottom checkbox is checked
Action Performed:
- Go to https://staging.expensify.cash
- Log in with any account
- Go to Setting - Profile
- Scroll down to Time zone field
- Set my time zone automatically should be selected
- Try to chose other time zone
Workaround:
Unknown
Platform:
Where is this issue occurring?
Web ✔️ iOS Android Desktop App Mobile Web
Version Number: 1.0.42-0
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos:

https://user-images.githubusercontent.com/44479856/117885489-e9502f80-b27b-11eb-8ebd-1405afa99e69.mp4
Expensify/Expensify Issue URL: https://github.com/Expensify/Expensify/issues/163784
Triggered auto assignment to @zanyrenney (AutoAssignerTriage), see https://stackoverflow.com/c/expensify/questions/4749 for more details.
Triggered auto assignment to @Dal-Papa (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.
Triggered auto assignment to @marklouisdeshaun (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.
Triggered auto assignment to @marcaaron (Exported), see https://stackoverflow.com/c/expensify/questions/7972 for more details.
While I can see that you pass disabled prop to Picker in src/pages/settings/Profile/ProfilePage.js, you don't actually pass it to RNPickerSelect in src/components/Picker/index.js.
So the fix is simply to add disabled to the list of destructed props of Picker component and pass it to RNPickerSelect.
Nice catch @dklymenk. Can we please also update the propTypes here so that it's clear we are passing this prop -> https://github.com/Expensify/Expensify.cash/blob/3fad8d181165842897e7259ecfbfe591976cf381/src/components/Picker/PickerPropTypes.js#L3
@marklouisdeshaun the solution from @dklymenk LGTM
It seems to be fine, but it isn't the correct way to fix. I think that there is not need to do so. There is more simple way to fix it.
While I can see that you pass disabled prop to
Pickerinsrc/pages/settings/Profile/ProfilePage.js, you don't actually pass it toRNPickerSelectinsrc/components/Picker/index.js.So the fix is simply to add
disabledto the list of destructed props ofPickercomponent and pass it toRNPickerSelect.
If it is a correct solution, why the issue occur on only Web? Is it okay on iOS and Android?

Actually reproduced the issue on both web and android, so the issue is not web only.
I submitted a draft PR with a fix #2824 , I'll test tomorrow for regressions on iOS and desktop app and remove draft label.
Thank you.
Confirm the fix works on all platforms. PR is ready for review