Pass maxLength directly to TextInput component

stable/1.0.x
Alex Gleason 2020-04-22 16:38:16 -05:00
rodzic 6fe57ca055
commit 1b1bf4cdbe
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
2 zmienionych plików z 2 dodań i 4 usunięć
app/gabsocial/features
edit_profile

Wyświetl plik

@ -92,6 +92,7 @@ class EditProfile extends ImmutablePureComponent {
name='display_name'
value={this.state.display_name}
maxLength={30}
size={30}
onChange={this.handleTextChange}
/>
<TextInput

Wyświetl plik

@ -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}