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

Turn iOS compose box uncontrolled; dedupe with Android #2886

Closed

Commits on Sep 5, 2018

  1. composebox: Unify two platform's code

    Remove the iOS code which was our old 'controlled' version and
    keep the new Android 'uncontrolled' version.
    
    While iOS does not have the extreme performance issues the Android
    app had because of bugs in React Native, it is still faster to not
    have the component controlled - a controlled compoennt would block
    any time the UI thread blocks.
    
    Another big benefit is removing the need to support two versions.
    
    Making the component uncontrolled fixes zulip#2434
    borisyankov committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    cc87383 View commit details
    Browse the repository at this point in the history
  2. composebox: Improve text resetting code, circumvent iOS bug

    Fixes: zulip#2434
    
    There is a simple hack/fix for the iOS-specific bug that was a
    blocker for us migrating the iOS version.
    
    If we set the text via `setNativeProps` twice in a row, it will
    indeed reset the contents, so the first time we use a space `' '`
    that looks empty but is different than the second time when we
    set it to an actually empty string '``'. We use `setTimeout` in
    order to give React Native a chance to update the native value
    before running the second time.
    
    For Android we don't need to call `setNativeProps` as the
    `TextInputReset.resetKeyboardInput` call does that. Also compared
    to the previous version we don't need to check if `TextInputReset`
    is defined as it isn't only for iOS and we `if` for that.
    borisyankov committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    5742d57 View commit details
    Browse the repository at this point in the history