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

Animations with KeyboardAwareScrollView have poor performance on iOS release #422

Closed
Moreno97 opened this issue Apr 24, 2024 · 8 comments
Closed
Assignees
Labels
🐛 bug Something isn't working 🍎 iOS iOS specific

Comments

@Moreno97
Copy link

Moreno97 commented Apr 24, 2024

Describe the bug
Animations with KeyboardAwareScrollView have poor performance on iOS release.

Code snippet

    <>
      <KeyboardAwareScrollView
        testID="keyboard-aware-scroll-view"
        keyboardShouldPersistTaps="handled"
        contentContainerStyle={{
               flexGrow: 1,
               padding: 16,
               backgroundColor: 'white',
        }}
        keyboardDismissMode="on-drag"
      >
      <View style={{ flex: 1 }}
       ...
      </View>
    </>

To Reproduce
Steps to reproduce the behavior:
Have an input and focus. I we have some buttons at the bottom, when placing at the top, animations are laggy.

Expected behavior
Animations shouldn´t be laggy and perfomance as 60/120 fps depending on device.

Screenshots

Release:

RPReplay_Final1713954733.MP4

Debug:

CleanShot.2024-04-24.at.12.59.01.mp4

Smartphone (please complete the following information):

  • Device: iPhone 14 Pro (seems to happen on all iOS devices)
  • OS: iOS 17.4.1
  • RN version: 0.73.5
  • RN architecture: Old
  • JS engine: Hermes
  • Library version: 1.11.6

Additional context
Seems to happen only on iOS devices and release flavour. On debug, everything is working fine 👍🏻 .

@kirillzyusko
Copy link
Owner

Hello @Moreno97

Would you mind to attach debug video as well so that I can compare two of them and have a better understanding of where performance drop happens?

@Moreno97
Copy link
Author

Moreno97 commented Apr 24, 2024

Hello @Moreno97

Would you mind to attach debug video as well so that I can compare two of them and have a better understanding of where performance drop happens?

Sure, is attached now 👍🏻 , thanks. Seems that is not noticiable on the video, but it works way better on Simulator than Release flavour on real device.

@kirillzyusko
Copy link
Owner

Sure, is attached now 👍🏻 , thanks. Seems that is not noticiable on the video, but it works way better on Simulator than Release flavour on real device.

Interesting, I'll have a look into it.

But may I ask you to try to comment out this line and see if it improves situation?

@Moreno97
Copy link
Author

Sure, is attached now 👍🏻 , thanks. Seems that is not noticiable on the video, but it works way better on Simulator than Release flavour on real device.

Interesting, I'll have a look into it.

But may I ask you to try to comment out this line and see if it improves situation?

I can try it building the app release on my device. I'll try it and update as soon as I can.
Thanks 🙂.

@kirillzyusko kirillzyusko added 🐛 bug Something isn't working 🍎 iOS iOS specific labels Apr 24, 2024
@kirillzyusko
Copy link
Owner

@Moreno97 potentially it can be fixed in #412

Can you try to install a library from latest main and check if it works better or not? 👀

@Moreno97
Copy link
Author

Moreno97 commented May 6, 2024

@Moreno97 potentially it can be fixed in #412

Can you try to install a library from latest main and check if it works better or not? 👀

Hello! I'll try as soon as possible.
Thanks! And KUDOS!

@Moreno97
Copy link
Author

Moreno97 commented May 8, 2024

@kirillzyusko installing the library from main seems to be working better on real device!! At least, animations are less laggy and now are "pretty almost native and at full speed".
Thanks!! We can close the issue <3.

@kirillzyusko
Copy link
Owner

@Moreno97 yoohoo 🎉 Thank you for the report and testing! 😊

There is still some room for further improvements, so I'm going to make them even better/smoother/precise, but I'll do it slightly later 👀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working 🍎 iOS iOS specific
Projects
None yet
Development

No branches or pull requests

2 participants