react-native-keyboard-controller icon indicating copy to clipboard operation
react-native-keyboard-controller copied to clipboard

Animations with KeyboardAwareScrollView have poor performance on iOS release

Open a-morenovalls opened this issue 1 year ago โ€ข 5 comments

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:

https://github.com/kirillzyusko/react-native-keyboard-controller/assets/17690283/e35b4b0b-c9da-43c8-876f-f0745700bfda

Debug:

https://github.com/kirillzyusko/react-native-keyboard-controller/assets/17690283/1472a29e-aaeb-4938-80b6-ca6787145f28

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 ๐Ÿ‘๐Ÿป .

a-morenovalls avatar Apr 24 '24 10:04 a-morenovalls

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?

kirillzyusko avatar Apr 24 '24 10:04 kirillzyusko

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.

a-morenovalls avatar Apr 24 '24 10:04 a-morenovalls

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?

kirillzyusko avatar Apr 24 '24 11:04 kirillzyusko

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 ๐Ÿ™‚.

a-morenovalls avatar Apr 24 '24 11:04 a-morenovalls

@Moreno97 potentially it can be fixed in https://github.com/kirillzyusko/react-native-keyboard-controller/pull/412

Can you try to install a library from latest main and check if it works better or not? ๐Ÿ‘€

kirillzyusko avatar May 03 '24 12:05 kirillzyusko

@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!

a-morenovalls avatar May 06 '24 08:05 a-morenovalls

@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.

a-morenovalls avatar May 08 '24 10:05 a-morenovalls

@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 ๐Ÿ‘€

kirillzyusko avatar May 08 '24 10:05 kirillzyusko