File tree Expand file tree Collapse file tree 4 files changed +15
-7
lines changed
components/src/layouts/TabView/StickyTabComponent Expand file tree Collapse file tree 4 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ export const TabComponent = (
26
26
tabContentContainerStyle,
27
27
style,
28
28
onRefresh : onRefreshCallBack ,
29
- initialHeaderHeight = 250 ,
29
+ initialHeaderHeight = 0 ,
30
30
} : ITabProps ,
31
31
// fix missing forwardRef warnings.
32
32
// eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -172,9 +172,18 @@ export const TabComponent = (
172
172
) ;
173
173
174
174
const onIndexChange = useCallback ( ( ) => { } , [ ] ) ;
175
- const onLayout = useCallback ( ( { nativeEvent } : LayoutChangeEvent ) => {
176
- setHeaderHeight ( nativeEvent . layout . height ) ;
177
- } , [ ] ) ;
175
+ const onLayout = useCallback (
176
+ ( { nativeEvent } : LayoutChangeEvent ) => {
177
+ if ( nativeEvent . layout . height === headerHeight ) {
178
+ return ;
179
+ }
180
+ if ( platformEnv . isNativeAndroid && initialHeaderHeight > 0 ) {
181
+ return ;
182
+ }
183
+ setHeaderHeight ( nativeEvent . layout . height ) ;
184
+ } ,
185
+ [ headerHeight , initialHeaderHeight ] ,
186
+ ) ;
178
187
return (
179
188
// @ts -expect-error
180
189
< NestedTabView
Original file line number Diff line number Diff line change @@ -137,8 +137,7 @@ function TokenListView(props: IProps) {
137
137
if (
138
138
( isTokenSelector && tokenSelectorSearchTokenState . isSearching ) ||
139
139
( ! isTokenSelector && searchTokenState . isSearching ) ||
140
- ( ! tokenListState . initialized && tokenListState . isRefreshing ) ||
141
- ( platformEnv . isNativeAndroid && isInRequest )
140
+ ( ! tokenListState . initialized && tokenListState . isRefreshing )
142
141
) {
143
142
return (
144
143
< NestedScrollView style = { { flex : 1 } } >
Original file line number Diff line number Diff line change @@ -140,6 +140,7 @@ export function HomePageView({
140
140
data = { tabs }
141
141
ListHeaderComponent = { < HomeHeaderContainer /> }
142
142
initialScrollIndex = { 0 }
143
+ initialHeaderHeight = { 220 }
143
144
contentItemWidth = { CONTENT_ITEM_WIDTH }
144
145
contentWidth = { screenWidth }
145
146
showsVerticalScrollIndicator = { false }
Original file line number Diff line number Diff line change @@ -153,7 +153,6 @@ function MarketHome() {
153
153
return (
154
154
< Tab
155
155
disableRefresh
156
- initialHeaderHeight = { 0 }
157
156
data = { tabConfig }
158
157
onSelectedPageIndex = { handleSelectedPageIndex }
159
158
/>
You can’t perform that action at this time.
0 commit comments