Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Padding showing when changing tabs. #32

Closed
kioopi opened this issue Jan 2, 2021 · 18 comments
Closed

Padding showing when changing tabs. #32

kioopi opened this issue Jan 2, 2021 · 18 comments
Labels
question Further information is requested

Comments

@kioopi
Copy link

kioopi commented Jan 2, 2021

Thank you for your great library!

When I have scrolled down on one tab so that the header is hidden and then change to another tab (via swipe or tap on the tab) that is scrolled all the way to the top, the paddingTop is showing. It would usually be obscured by the header and tabs but the header is shrunk because of the interaction with the previous tab.

Is there known solution for this? Or a canonical approach?
Thank you very much for your time.

@kioopi kioopi added the question Further information is requested label Jan 2, 2021
@PedroBern
Copy link
Owner

Hi @kioopi can you provide a reproducible demo or a gif/ small video? It's an android or iOS?

@Janak-Nirmal
Copy link

Hi @PedroBern

Its really awesome library and your support even makes it cherry on the top. Below is the video of this issue.

  • Scroll to the end in Tab1, Tab2 has short content but it still scrolls to end. Now if you try to scroll in Tab2 it will reset its offset and that's the issue I believe.
  • Hope this helps to understand the issue
Screen.Recording.2021-01-03.at.1.10.24.PM.mov

@Janak-Nirmal
Copy link

Janak-Nirmal commented Jan 3, 2021

@PedroBern I tried to investigate and it seems when TabView index is changed syncScrollOffsets is not called somehow. Tried to add manually handling to onIndexChange

  const onTabIndexChanged = (nIndex) => {
    const {onIndexChange} = tabViewProps;
    onIndexChange && onIndexChange(nIndex);
    syncScrollOffsets();
  };

...
...
...
  <TabView
    {...tabViewProps}
    onIndexChange={onTabIndexChanged}
    navigationState={{index, routes}}
    renderTabBar={renderTabBar}
  />

Just wanted to help so I tried :)

But this doesn't work properly, it has other side effects it resets current scrolled position of
individual Tabs.

This happens only when we set lazy={true} prop , if we set lazy={false} than this doesn't happen.

@kioopi
Copy link
Author

kioopi commented Jan 3, 2021

@Janak-Nirmal Thanks you, that is exactly what i was encountering. The blank space above the round images on the second tab.
I'll try to experiment with syncScrollOffsets and lazy.

@PedroBern
Copy link
Owner

@Janak-Nirmal thanks for the help 👍

This happens only when we set lazy={true} prop , if we set lazy={false} than this doesn't happen.

@kioopi see #19, does it happen if using lazy={false}?

@Janak-Nirmal
Copy link

@PedroBern yes if you set lazy=false than it doesn't happen.

@PedroBern
Copy link
Owner

closing in favor of #19

@carlos187-dev
Copy link

carlos187-dev commented Jan 8, 2021

I still having this issue even with lazy={false} please I need her :(

@ariesbrylle-bms
Copy link

@PedroBern I tried to investigate and it seems when TabView index is changed syncScrollOffsets is not called somehow. Tried to add manually handling to onIndexChange

  const onTabIndexChanged = (nIndex) => {
    const {onIndexChange} = tabViewProps;
    onIndexChange && onIndexChange(nIndex);
    syncScrollOffsets();
  };

...
...
...
  <TabView
    {...tabViewProps}
    onIndexChange={onTabIndexChanged}
    navigationState={{index, routes}}
    renderTabBar={renderTabBar}
  />

Just wanted to help so I tried :)

But this doesn't work properly, it has other side effects it resets current scrolled position of
individual Tabs.

This happens only when we set lazy={true} prop , if we set lazy={false} than this doesn't happen.

Tried this but the problem still occurs.

@ariesbrylle-bms
Copy link

I still having this issue even with lazy={false} please I need her :(

Same here :(

@PedroBern
Copy link
Owner

related: #26

@PedroBern PedroBern mentioned this issue Jan 14, 2021
PedroBern added a commit that referenced this issue Jan 22, 2021
add new API, remove react-native-tab-view.

BREAKING CHANGE: remove react-native-tab-view

v3 has nothing backward compatible, it's a completely new API.

Fixes: #2, #38, #32, #26
PedroBern added a commit that referenced this issue Jan 22, 2021
add new API, remove react-native-tab-view.

BREAKING CHANGE: remove react-native-tab-view

v3 has nothing backward compatible, it's a completely new API.

Fixes: #2, #38, #32, #26
@PedroBern
Copy link
Owner

PedroBern commented Jan 22, 2021

fixed in v3 👍

@sadia-onyxtec
Copy link

Thanks for this library. I am using ^5.0.0-rc.10 and still facing this issue while using onIndexChange.

@calz10
Copy link

calz10 commented Jun 4, 2022

yeah the issue does still exist on my end though I use the latest version.

Thanks for this library. I am using ^5.0.0-rc.10 and still facing this issue while using onIndexChange.

@KuiGoan
Copy link

KuiGoan commented Jun 10, 2022

Same +1

1 similar comment
@AnasAli91
Copy link

Same +1

@ivanichoo
Copy link

Hello,

Got the same bug for flashlist tabs with dynamic height. I have been trying all solutions above but nothing works or is table.

"expo": "~48.0.12",
"react-native": "0.71.8",
"react-native-collapsible-tab-view": "^6.2.0"

@iy-913
Copy link

iy-913 commented Dec 10, 2023

#354 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests