Skip to content

Commit

Permalink
fix: Header scroll bug on ios
Browse files Browse the repository at this point in the history
There is something with contentInset and refreshControl which is
causing trouble with the ParallaxScroll component on ios. As of
now fixed by disabling the RefreshControl loading spinner on ios.
  • Loading branch information
gorandalum committed Jun 30, 2023
1 parent bd8b30c commit 830c036
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/nearby-stop-places/NearbyStopPlacesScreenComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {NearbyTexts, useTranslation} from '@atb/translations';
import DeparturesTexts from '@atb/translations/screens/Departures';
import {useIsFocused} from '@react-navigation/native';
import React, {useEffect, useMemo, useState} from 'react';
import {RefreshControl, View} from 'react-native';
import {Platform, RefreshControl, View} from 'react-native';
import {StopPlacesMode} from './types';
import {FullScreenView} from '@atb/components/screen-view';
import {ScreenHeaderProps} from '@atb/components/screen-header';
Expand Down Expand Up @@ -152,7 +152,10 @@ export const NearbyStopPlacesScreenComponent = ({
return (
<FullScreenView
refreshControl={
<RefreshControl refreshing={isLoading} onRefresh={refresh} />
<RefreshControl
refreshing={Platform.OS === 'ios' ? false : isLoading}
onRefresh={refresh}
/>
}
headerProps={headerProps}
parallaxContent={() => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import {useIsFocused, useNavigation} from '@react-navigation/native';
import React, {useCallback, useEffect, useMemo, useState} from 'react';
import {
ActivityIndicator,
Platform,
RefreshControl,
TouchableOpacity,
View,
Expand Down Expand Up @@ -248,7 +249,11 @@ export const Dashboard_TripSearchScreen: React.FC<RootProps> = ({
}}
refreshControl={
<RefreshControl
refreshing={searchState === 'searching' && !tripPatterns.length}
refreshing={
Platform.OS === 'ios'
? false
: searchState === 'searching' && !tripPatterns.length
}
onRefresh={refresh}
/>
}
Expand Down

0 comments on commit 830c036

Please sign in to comment.