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'
|
name='display_name'
|
||||||
value={this.state.display_name}
|
value={this.state.display_name}
|
||||||
maxLength={30}
|
maxLength={30}
|
||||||
|
size={30}
|
||||||
onChange={this.handleTextChange}
|
onChange={this.handleTextChange}
|
||||||
/>
|
/>
|
||||||
<TextInput
|
<TextInput
|
||||||
|
|
|
@ -191,11 +191,10 @@ export class TextInput extends ImmutablePureComponent {
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
label: PropTypes.string,
|
label: PropTypes.string,
|
||||||
maxLength: PropTypes.number,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { label, maxLength, ...props } = this.props;
|
const { label, ...props } = this.props;
|
||||||
const id = uuidv4();
|
const id = uuidv4();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -204,9 +203,7 @@ export class TextInput extends ImmutablePureComponent {
|
||||||
<label className='string optional' htmlFor={id}>{label}</label>
|
<label className='string optional' htmlFor={id}>{label}</label>
|
||||||
<div className='label_input__wrapper'>
|
<div className='label_input__wrapper'>
|
||||||
<input
|
<input
|
||||||
maxlength={maxLength}
|
|
||||||
className='string optional'
|
className='string optional'
|
||||||
size={maxLength}
|
|
||||||
type='text'
|
type='text'
|
||||||
id={id}
|
id={id}
|
||||||
{...props}
|
{...props}
|
||||||
|
|
Loading…
Reference in a new issue