-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[Tabs] Default 'width' to 'auto' instead of '100 / n%' #3807
Comments
This PR #2861 was going into this direction. You can read it if you are interested.
I think that we should have a property to enable this feature 👍 . |
I think it'd be a sensible choice to default the width to 'auto'. It would do no harm from a backwards compatibility perspective. Anyone currently using the Tabs component with Tabs that have same width would not be impacted, as it would render identically. |
@alitaheri is still working on a fork of #2861. Might be worth waiting until he's back from vacation to see whether this is already covered. In any case, I understand what you're saying about auto by default being a non-breaking change, as |
I'm back 😁
And Scrollable Tabs must have Is that ok? does that make sense? |
I realized a new concern when working with tabs today. The inkbar implementation is percentage-based. so if you create In this particular case, the inkbar bleeds into the leftmost tab with |
Yeah I'm working on a method to calculate the position the inkbar should be in using getBoundingRect. this way, the inkbar will be positioned correctly depending on hot each Tab is rendered, not on how it assumes it will be rendered. |
Any update on this? The only way to do this is to either try to calculate the width based off the text length (which is janky), or explicitly set the padding to what I want which screws up the ripple. |
I propose considering that
Tab
components are not equal width by default. If you are putting content in theTab
elements of variable width, the tabs do not render gracefully:In the situation below, my
Tabs
are in side anAppBar
component.Tabs
with 'width' set to '100 / n%' (in this case, 20%):Tabs
with 'width' set to 'auto':I'd be happy to open a PR if consensus is in favor of the change.
The text was updated successfully, but these errors were encountered: