Pass maxLength directly to TextInput component
This commit is contained in:
parent
6fe57ca055
commit
1b1bf4cdbe
2 changed files with 2 additions and 4 deletions
|
@ -92,6 +92,7 @@ class EditProfile extends ImmutablePureComponent {
|
|||
name='display_name'
|
||||
value={this.state.display_name}
|
||||
maxLength={30}
|
||||
size={30}
|
||||
onChange={this.handleTextChange}
|
||||
/>
|
||||
<TextInput
|
||||
|
|
|
@ -191,11 +191,10 @@ export class TextInput extends ImmutablePureComponent {
|
|||
|
||||
static propTypes = {
|
||||
label: PropTypes.string,
|
||||
maxLength: PropTypes.number,
|
||||
}
|
||||
|
||||
render() {
|
||||
const { label, maxLength, ...props } = this.props;
|
||||
const { label, ...props } = this.props;
|
||||
const id = uuidv4();
|
||||
|
||||
return (
|
||||
|
@ -204,9 +203,7 @@ export class TextInput extends ImmutablePureComponent {
|
|||
<label className='string optional' htmlFor={id}>{label}</label>
|
||||
<div className='label_input__wrapper'>
|
||||
<input
|
||||
maxlength={maxLength}
|
||||
className='string optional'
|
||||
size={maxLength}
|
||||
type='text'
|
||||
id={id}
|
||||
{...props}
|
||||
|
|
Loading…
Reference in a new issue