Skip to content
This repository has been archived by the owner on Dec 23, 2022. It is now read-only.

Commit

Permalink
Fix 'required' prop for non-empty chip sets. (#315)
Browse files Browse the repository at this point in the history
* Fix 'required' prop for non-empty chip sets.

* Update ChipInput.js

Co-authored-by: Maik Marschner <m.marschner@wertarbyte.com>
  • Loading branch information
benwiley4000 and leMaik committed Apr 26, 2020
1 parent aebb65c commit 9801cda
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ChipInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ class ChipInput extends React.Component {
[classes.marginDense]: other.margin === 'dense'
})}
error={error}
required={required}
required={chips.length > 0 ? undefined : required}
onClick={this.focus}
disabled={disabled}
variant={variant}
Expand All @@ -590,6 +590,7 @@ class ChipInput extends React.Component {
focused={this.state.isFocused}
variant={variant}
ref={this.labelRef}
required={required}
{...InputLabelProps}
>
{label}
Expand Down

0 comments on commit 9801cda

Please sign in to comment.