Skip to content

Fix picker still avoiding view when the picker itself is unmounted #13

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

Merged

Conversation

bernhardoj
Copy link

@bernhardoj bernhardoj commented Jul 20, 2023

Description
PickerAvoidingView is added in this PR to make sure the input that triggers the picker is not covered by the picker modal itself, similar to what KeyboardAvoidingView is doing.

It works by maintaining the picker modal visibility state in a context. However, the handling of the state does not take into account if the picker itself is unmounted from the screen resulting in the visibility state being stuck at true.

Test plan
Use this branch/commit and test if the issue at Expensify/App#23044 is resolved.

Test step:

  1. Open Settings > Workspaces > Select any workspace > Bank Account
  2. Complete the first step
  3. On the 2nd step, find any field with a picker, for example, State, and press it to show the picker.
  4. Put the app to background
  5. Open the app back
  6. Notice that going back to the app will show a loading screen for a while. After the loading completes, verify the 2nd step shows back
  7. Verify the page is not cut off
Screen.Recording.2023-07-20.at.13.13.21.mov

Copy link

@s77rt s77rt left a comment

Choose a reason for hiding this comment

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

LGTM! 🚀

cc @srikarparsi

@srikarparsi srikarparsi self-requested a review July 20, 2023 18:39
Copy link

@srikarparsi srikarparsi left a comment

Choose a reason for hiding this comment

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

looks good to me as well, thanks for this quick changes!

@srikarparsi srikarparsi merged commit eae0585 into Expensify:master Jul 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants