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 = (
2626 tabContentContainerStyle,
2727 style,
2828 onRefresh : onRefreshCallBack ,
29- initialHeaderHeight = 250 ,
29+ initialHeaderHeight = 0 ,
3030 } : ITabProps ,
3131 // fix missing forwardRef warnings.
3232 // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -172,9 +172,18 @@ export const TabComponent = (
172172 ) ;
173173
174174 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+ ) ;
178187 return (
179188 // @ts -expect-error
180189 < NestedTabView
Original file line number Diff line number Diff line change @@ -137,8 +137,7 @@ function TokenListView(props: IProps) {
137137 if (
138138 ( isTokenSelector && tokenSelectorSearchTokenState . isSearching ) ||
139139 ( ! isTokenSelector && searchTokenState . isSearching ) ||
140- ( ! tokenListState . initialized && tokenListState . isRefreshing ) ||
141- ( platformEnv . isNativeAndroid && isInRequest )
140+ ( ! tokenListState . initialized && tokenListState . isRefreshing )
142141 ) {
143142 return (
144143 < NestedScrollView style = { { flex : 1 } } >
Original file line number Diff line number Diff line change @@ -140,6 +140,7 @@ export function HomePageView({
140140 data = { tabs }
141141 ListHeaderComponent = { < HomeHeaderContainer /> }
142142 initialScrollIndex = { 0 }
143+ initialHeaderHeight = { 220 }
143144 contentItemWidth = { CONTENT_ITEM_WIDTH }
144145 contentWidth = { screenWidth }
145146 showsVerticalScrollIndicator = { false }
Original file line number Diff line number Diff line change @@ -153,7 +153,6 @@ function MarketHome() {
153153 return (
154154 < Tab
155155 disableRefresh
156- initialHeaderHeight = { 0 }
157156 data = { tabConfig }
158157 onSelectedPageIndex = { handleSelectedPageIndex }
159158 />
You can’t perform that action at this time.
0 commit comments