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

TabIndicatorProps is useless #16697

Closed
1 of 2 tasks
tommybernaciak opened this issue Jul 23, 2019 · 3 comments · Fixed by #16628
Closed
1 of 2 tasks

TabIndicatorProps is useless #16697

tommybernaciak opened this issue Jul 23, 2019 · 3 comments · Fixed by #16628
Assignees
Labels
component: tabs This is the name of the generic UI component, not the React module! duplicate This issue or pull request already exists v4.x

Comments

@tommybernaciak
Copy link

I am trying to restyle Tabs and Tabs indicator component. What I wanted to achieve is to make tab indicator smaller (80%). Is surprised me this is not possible in your current implementation. Documentation (https://material-ui.com/api/tabs) says that Tabs accept TabIndicatorProps that will be passed to indicator. However, the interface for it looks like this:

export interface TabIndicatorProps
  extends StandardProps<React.HTMLAttributes<HTMLDivElement>, TabIndicatorClassKey> {
  color: 'secondary' | 'primary' | string;
  style: { left: number; width: number };
}

Accepted style property is left and width as numbers. This is then used for indicator as left margin and width both in pixels. I believe width should accept string values like 80% or 100px. Now it is inconsisted and missleading. It is also useless it will never be responsive.

  • This is not a v0.x issue.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior 🤔

TabIndicatorProps should accept style: { left: number; width: string } and use width directly.

Current Behavior 😯

TabIndicatorProps should accepts style: { left: number; width: number } and width can be customized in pixels only.

Your Environment 🌎

{
    "compilerOptions": {
        "target": "es5",
        "downlevelIteration": true,
        "lib": ["dom", "dom.iterable", "esnext"],
        "allowJs": true,
        "skipLibCheck": true,
        "esModuleInterop": true,
        "allowSyntheticDefaultImports": true,
        "strict": true,
        "forceConsistentCasingInFileNames": true,
        "module": "esnext",
        "moduleResolution": "node",
        "resolveJsonModule": true,
        "isolatedModules": true,
        "noEmit": true,
        "jsx": "preserve"
    },
    "include": ["src"],
	"plugins": [
		{ "transform": "ts-optchain/transform" },
	]
}
Tech Version
Material-UI v4.2.0
React 16.8.6
Browser brave
TypeScript 3.4.5
etc.
@oliviertassinari
Copy link
Member

oliviertassinari commented Jul 23, 2019

Related to #16628 (comment). Does the changes in the pull request solve the problem?

@tommybernaciak
Copy link
Author

@oliviertassinari O yes, this should work I believe

@oliviertassinari
Copy link
Member

Awesome :)

@oliviertassinari oliviertassinari self-assigned this Jul 23, 2019
@oliviertassinari oliviertassinari added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Dec 20, 2022
@zannager zannager added the component: tabs This is the name of the generic UI component, not the React module! label Dec 20, 2022
@zannager zannager added duplicate This issue or pull request already exists v4.x and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jan 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: tabs This is the name of the generic UI component, not the React module! duplicate This issue or pull request already exists v4.x
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants