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

Fix PickerAndroid will reset selected value during items update. #24793

Closed
wants to merge 1 commit into from

Commits on May 10, 2019

  1. Fix PickerAndroid will reset selected value during items update.

    Summary:
      Two root causes:
      1. Android Spinner will reset selection to undefined after setAdapter()
         which will trigger onValueChange().
         The behavior is not expected for RN.
         And the solution is to setSelection() explicitly
    
      2. In original implementation, it setups `items` immediately,
         but delays the `selected` after update transaction.
         There will be some race condition and incosistency
         if update `items` only.
         The fix will update both after transaction.
    
      Fixes facebook#13351
    Kudo committed May 10, 2019
    Configuration menu
    Copy the full SHA
    5ace636 View commit details
    Browse the repository at this point in the history