[Tabs] Default to width: auto
. Add fillWidth
prop.
#5969
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Per the Material Guidelines, it is allowed for tabs with be
width: auto;
. On desktop, this seems to be the default. On mobile, the default seems to be the current behavior of Material UI's tabs.Per the discussion in #3807, it sounds like the general preference is to default to
width: auto;
. The downside is that this is backwards incompatible. Happy to discuss and make changes if necessary.From the Material Guidelines:
This PR changes the default behavior of tabs to be
width: auto;
. It also adds a new prop,fillWidth
, that will give the current behavior.This PR is missing tests, so it shouldn't be merged yet. I'm not sure what the best way to test this is. Adding a couple tabs and checking their width makes sense, but I'm not exactly sure how to get the width of an element in a test. I welcome any thoughts on this.
Fixes #3807.