@@ -1106,16 +1106,31 @@ export class Tabs extends TabsBase {
1106
1106
// do not make layout changes while the animation is in progress https://stackoverflow.com/a/47031524/613113
1107
1107
this . visitFrames ( item , ( frame ) => ( frame . _animationInProgress = true ) ) ;
1108
1108
1109
+ const doneAnimating = ( ) => {
1110
+ this . visitFrames ( item , ( frame ) => ( frame . _animationInProgress = false ) ) ;
1111
+
1112
+ this . _canSelectItem = true ;
1113
+ this . _setCanBeLoaded ( value ) ;
1114
+ this . _loadUnloadTabItems ( value ) ;
1115
+ } ;
1116
+
1109
1117
invokeOnRunLoop ( ( ) =>
1110
1118
this . viewController . setViewControllersDirectionAnimatedCompletion ( controllers , navigationDirection , this . animationEnabled , ( finished : boolean ) => {
1111
- this . visitFrames ( item , ( frame ) => ( frame . _animationInProgress = false ) ) ;
1112
1119
if ( finished ) {
1113
- // HACK: UIPageViewController fix; see https://stackoverflow.com/a/17330606
1114
- invokeOnRunLoop ( ( ) => this . viewController . setViewControllersDirectionAnimatedCompletion ( controllers , navigationDirection , false , null ) ) ;
1115
-
1116
- this . _canSelectItem = true ;
1117
- this . _setCanBeLoaded ( value ) ;
1118
- this . _loadUnloadTabItems ( value ) ;
1120
+ if ( this . animationEnabled ) {
1121
+ // HACK: UIPageViewController fix; see https://stackoverflow.com/a/17330606
1122
+ // Prior Hack fails on iOS 10.3 during tests with v8 engine...
1123
+ // Leaving the above link in case we need to special case this for only iOS > 10.3?
1124
+
1125
+ // HACK: UIPageViewController fix; see https://stackoverflow.com/questions/15325891
1126
+ invokeOnRunLoop ( ( ) => {
1127
+ this . viewController . dataSource = null ;
1128
+ ( this . viewController as any ) . dataSource = this . viewController ;
1129
+ doneAnimating ( ) ;
1130
+ } ) ;
1131
+ } else {
1132
+ doneAnimating ( ) ;
1133
+ }
1119
1134
}
1120
1135
} )
1121
1136
) ;
0 commit comments