Skip to content

Commit

Permalink
fix(TextInput): remove duplicate class when custom class passed down (#…
Browse files Browse the repository at this point in the history
…12374)

* fix(TextInput): remove duplicate class when custom class passed down

* test(snapshot): update snapshots

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
tw15egan and kodiakhq[bot] committed Oct 24, 2022
1 parent 4b1ad5a commit e7f78d2
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 5 deletions.
2 changes: 0 additions & 2 deletions packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap
Expand Up @@ -1313,7 +1313,6 @@ Map {
"ControlledPasswordInput" => Object {
"$$typeof": Symbol(react.forward_ref),
"defaultProps": Object {
"className": "\${prefix}--text__input",
"disabled": false,
"helperText": "",
"invalid": false,
Expand Down Expand Up @@ -7639,7 +7638,6 @@ Map {
"ControlledPasswordInput": Object {
"$$typeof": Symbol(react.forward_ref),
"defaultProps": Object {
"className": "\${prefix}--text__input",
"disabled": false,
"helperText": "",
"invalid": false,
Expand Down
Expand Up @@ -262,7 +262,6 @@ ControlledPasswordInput.propTypes = {
};

ControlledPasswordInput.defaultProps = {
className: '${prefix}--text__input',
disabled: false,
onChange: () => {},
onClick: () => {},
Expand Down
2 changes: 0 additions & 2 deletions packages/react/src/components/TextInput/TextInput.js
Expand Up @@ -63,12 +63,10 @@ const TextInput = React.forwardRef(function TextInput(
warnText,
});

const customClassName = className ?? `${prefix}--text__input`;
const textInputClasses = classNames(
`${prefix}--text-input`,
[enabled ? null : className],
{
[customClassName]: enabled,
[`${prefix}--text-input--light`]: light,
[`${prefix}--text-input--invalid`]: normalizedProps.invalid,
[`${prefix}--text-input--warning`]: normalizedProps.warn,
Expand Down

0 comments on commit e7f78d2

Please sign in to comment.