App icon indicating copy to clipboard operation
App copied to clipboard

Timezone - Dropdown is selectable when the "Set my time zone" bottom checkbox is checked

Open isagoico opened this issue 5 years ago • 13 comments

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:

  1. Go to https://staging.expensify.cash
  2. Log in with any account
  3. Go to Setting - Profile
  4. Scroll down to Time zone field
  5. Set my time zone automatically should be selected
  6. 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: image

https://user-images.githubusercontent.com/44479856/117885489-e9502f80-b27b-11eb-8ebd-1405afa99e69.mp4

Expensify/Expensify Issue URL: https://github.com/Expensify/Expensify/issues/163784

View all open jobs on Upwork

isagoico avatar May 11 '21 21:05 isagoico

Triggered auto assignment to @zanyrenney (AutoAssignerTriage), see https://stackoverflow.com/c/expensify/questions/4749 for more details.

MelvinBot avatar May 11 '21 21:05 MelvinBot

Triggered auto assignment to @Dal-Papa (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

MelvinBot avatar May 12 '21 08:05 MelvinBot

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

MelvinBot avatar May 12 '21 14:05 MelvinBot

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

MelvinBot avatar May 12 '21 15:05 MelvinBot

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.

dklymenk avatar May 12 '21 16:05 dklymenk

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

marcaaron avatar May 12 '21 16:05 marcaaron

@marklouisdeshaun the solution from @dklymenk LGTM

marcaaron avatar May 12 '21 16:05 marcaaron

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.

johndev0711 avatar May 12 '21 16:05 johndev0711

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.

If it is a correct solution, why the issue occur on only Web? Is it okay on iOS and Android?

johndev0711 avatar May 12 '21 16:05 johndev0711

image

johndev0711 avatar May 12 '21 16:05 johndev0711

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.

dklymenk avatar May 12 '21 18:05 dklymenk

Confirm the fix works on all platforms. PR is ready for review

dklymenk avatar May 13 '21 10:05 dklymenk