Added isRequired opt to Input, Textarea
• Added: - isRequired opt to Input, Textarea
This commit is contained in:
parent
9ca6b6a884
commit
8d07aa7564
@ -29,6 +29,7 @@ class Input extends React.PureComponent {
|
||||
id,
|
||||
hideLabel,
|
||||
maxLength,
|
||||
isRequired,
|
||||
} = this.props
|
||||
|
||||
const inputClasses = CX({
|
||||
@ -93,6 +94,7 @@ class Input extends React.PureComponent {
|
||||
onBlur={onBlur}
|
||||
readOnly={readOnly}
|
||||
maxLength={maxLength}
|
||||
required={isRequired ? true : undefined}
|
||||
/>
|
||||
|
||||
{
|
||||
@ -128,6 +130,7 @@ Input.propTypes = {
|
||||
readOnly: PropTypes.string,
|
||||
inputRef: PropTypes.func,
|
||||
id: PropTypes.string.isRequired,
|
||||
isRequired: PropTypes.bool,
|
||||
hideLabel: PropTypes.bool,
|
||||
maxLength: PropTypes.number,
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ class Textarea extends React.PureComponent {
|
||||
onFocus,
|
||||
onBlur,
|
||||
title,
|
||||
isRequired,
|
||||
} = this.props
|
||||
|
||||
const inputClasses = CX({
|
||||
@ -57,6 +58,7 @@ class Textarea extends React.PureComponent {
|
||||
onKeyUp={onKeyUp}
|
||||
onFocus={onFocus}
|
||||
onBlur={onBlur}
|
||||
required={isRequired ? true : undefined}
|
||||
/>
|
||||
|
||||
</div>
|
||||
@ -74,6 +76,7 @@ Textarea.propTypes = {
|
||||
onFocus: PropTypes.func,
|
||||
onBlur: PropTypes.func,
|
||||
title: PropTypes.string,
|
||||
isRequired: PropTypes.bool,
|
||||
}
|
||||
|
||||
export default Textarea
|
Loading…
Reference in New Issue
Block a user