PedroBern / react-native-collapsible-tab-view

A cross-platform Collapsible Tab View component for React Native
MIT License
804 stars 160 forks source link

`tabName` is wrong for 3+ tabs #366

Open ivanichoo opened 9 months ago

ivanichoo commented 9 months ago

Hello,

I think there might be a bug regarding data.tabName on onTabChange props when there are more than 2+ tabs.

Considering ABC Tabs, when I click from A to C, tabName is B instead of C :

{ prevIndex: 0, index: 1, prevTabName: 'A', tabName: 'B' }

Is it a known bug ?

My goal is to set an active label only when clicked when there are more than 3 tabs. (Current behavior chains A, B, C to active from A to C)

Thank you !

starlitya commented 7 months ago

hi team, I'm facing the same problem.

While I clicked from Tab_A to Tab_C, I received two of events

{ prevIndex: 0, index: 1, prevTabName: 'Tab_A', tabName: 'Tab_B' }
{ prevIndex: 1, index: 2, prevTabName: 'Tab_B, tabName: 'Tab_C' } 

I think that it seems scroll to Tab_B first, then scroll to Tab_C. Please help to look, thanks!