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

[material-ui][FilledInput] Remove unused classes from FilledInputClasses interface #44990

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions docs/pages/material-ui/api/filled-input.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,6 @@
"description": "Styles applied to the root element if `startAdornment` is provided.",
"isGlobal": false
},
{
"key": "colorSecondary",
"className": "MuiFilledInput-colorSecondary",
"description": "Styles applied to the root element if color secondary.",
"isGlobal": false
},
{
"key": "disabled",
"className": "Mui-disabled",
Expand Down
5 changes: 0 additions & 5 deletions docs/translations/api-docs/filled-input/filled-input.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,6 @@
"nodeName": "the root element",
"conditions": "<code>startAdornment</code> is provided"
},
"colorSecondary": {
"description": "Styles applied to {{nodeName}} if {{conditions}}.",
"nodeName": "the root element",
"conditions": "color secondary"
},
"disabled": {
"description": "State class applied to {{nodeName}} if {{conditions}}.",
"nodeName": "the root element",
Expand Down
6 changes: 6 additions & 0 deletions packages/mui-material/src/FilledInput/FilledInput.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,10 @@ describe('<FilledInput />', () => {
expect(root).to.have.class(classes.adornedEnd);
expect(root).to.have.class(classes.adornedStart);
});

it('should not have colorSecondary class on FilledInput', () => {
render(<FilledInput color="secondary" />);
expect(document.querySelector(`.MuiFilledInput-colorSecondary`)).to.equal(null);
expect(document.querySelector(`.MuiInputBase-colorSecondary`)).to.not.equal(null);
});
});
2 changes: 0 additions & 2 deletions packages/mui-material/src/FilledInput/filledInputClasses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import { inputBaseClasses } from '../InputBase';
export interface FilledInputClasses {
/** Styles applied to the root element. */
root: string;
/** Styles applied to the root element if color secondary. */
colorSecondary: string;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of adding the class to the DOM, I chose to remove it here. The fact that no users have reported this issue, even though it has likely existed for a long time (possibly since v5), suggests that it is not widely used. Therefore, I decided to remove the class instead of adding it to the DOM.

/** Styles applied to the root element unless `disableUnderline={true}`. */
underline: string;
/** State class applied to the root element if the component is focused. */
Expand Down
Loading