nativescript-community / ui-material-components

Monorepo that contains all of the NativeScript Material Design plugins.
https://nativescript-community.github.io/ui-material-components/
Apache License 2.0
218 stars 80 forks source link

[ios] Tab animation stopping halfway through screen render - Nativescript Vue #381

Open msl2000 opened 2 years ago

msl2000 commented 2 years ago

Make sure to check the demo app(s) for sample usage

Make sure to check the existing issues in this repository

If the demo apps cannot help and there is no issue for your problem, tell us about it

Please, ensure your title is less than 63 characters long and starts with a capital letter.

Which platform(s) does your issue occur on?

-iOS only

Please, provide the following version numbers that your issue occurs with:

Please, tell us how to recreate the issue in as much detail as possible.

I have a segmented bar that acts as a custom Tabs control. However, I found that transitioning between tabs causes the next tab page to not fully show. It's as if the animation just stops partway through. See walkthrough below:

Screen Shot 2022-05-02 at 12 59 42 pm

We then navigate to another tab ->

Screen Shot 2022-05-02 at 12 59 47 pm

I then try to navigate to the third tab and it just pushes the previous tab a slight bit further to view

Screen Shot 2022-05-02 at 12 59 52 pm

This is shown in our production app and was just wondering what could cause this behavior. This problem does not exist in android. Any help would be greatly appreciated.

farfromrefug commented 2 years ago

@msl2000 could you try and create a reproducible simple example ? without it it will be hard to fix

msl2000 commented 2 years ago

I found the issue to some degree. Each of those tab runs an http request using axios. It seems when a response is returned while the tab is animating, it stops and kills it. I found a work around by adding a placeholder layout that disappears 500 ms after the http request completes (settimeout). This isn't really elegant though, but it allows the tab to finish animating.

As for a reproducible system, set the offscreenTabLimit to 1 and add an http request that returns and displays a list in the tab (Preferable if it contains a gridlayout). It will freeze the animation.

farfromrefug commented 2 years ago

@msl2000 sorry you ll have to investigate this one yourself. It is a very specific use case. I dont have the time to look at this :s