react-native-tab-view icon indicating copy to clipboard operation
react-native-tab-view copied to clipboard

[RFC] Dynamic tab width

Open sospedra opened this issue 9 years ago • 13 comments

I'm planning to make a PR adding the desired and very intrinsic material design feature of having dynamic width sizes for each tab. By extension, other problems like multilines or ellipsis will be addresses to.

I made some proof of concepts and I find a proper way to make it dynamic. Tho, it relies onto onLayout. Before invest a hard time making the PR I'm wondering if you can see any downside with this approach or shall I continue with the proposal.

cc @satya164

sospedra avatar Sep 28 '17 07:09 sospedra

😞

sospedra avatar Oct 03 '17 13:10 sospedra

Hey. Sorry I was busy. Feel free to open a WIP PR. I'll take a look.

satya164 avatar Oct 03 '17 13:10 satya164

@sospedra hey! I'am waiting for your PR too :)

cheesytim avatar Oct 13 '17 13:10 cheesytim

@sospedra hey! I'am waiting for your PR too :)

lucaslz2020 avatar Jan 16 '18 12:01 lucaslz2020

is there any updates?

anoopmm avatar Apr 02 '18 05:04 anoopmm

I was working on this the past week. Is much more complicated than I thought. My idea was to wait until the tabs are rendered and the get the width from the layout. Problem is with the total width of the tabbar which works terribly bad with this dynamic idea. I still think is possible but a bigger refactor is needed beforehand.

If anyone is interested in this feature and is willing to work on that I'm open to chat about my research so far.

sospedra avatar Apr 02 '18 11:04 sospedra

I'm not against refactoring the TabBar if we can support dynamic tab width while keeping the current set of features.

satya164 avatar Apr 02 '18 12:04 satya164

@sospedra I am not sure, but, I guess, by using ViewPropTypes of RN, this can be solved. I saw it from here

Louies89 avatar Apr 15 '18 19:04 Louies89

I can help test as we're looking for this as well.

pribeh avatar Apr 29 '18 14:04 pribeh

I can help as well

gabrielvcbessa avatar May 02 '18 17:05 gabrielvcbessa

https://github.com/react-native-community/react-native-tab-view/pull/526 Maybe this PR will help you, i was doin counting View - width and total them all, so label and indicator now can have dynamic width depends on your width. still need improvement on this code

this is my last change https://github.com/react-native-community/react-native-tab-view/pull/526/commits/720b02f05382e2706fef8988808534c5cc454252

never00miss avatar May 18 '18 08:05 never00miss

I just created PR #544 which is our take on implementing dynamic width TabBar

jaitd avatar Jun 15 '18 10:06 jaitd

Hey, I just released a new alpha 2.0.0-alpha.0 of the library. It's rewritten using react-native-gesture-handler and react-native-reanimated addresses a many platform specific bugs and performance problems. The documentation is updated as well.

Please try the new version and see if it addresses your issue. If not, please open a new issue following the issue template.

satya164 avatar Feb 19 '19 22:02 satya164