Handle submit event of new list form (#5895)
This commit is contained in:
parent
9c1cbddf70
commit
f6b7869a2c
2 changed files with 9 additions and 7 deletions
|
@ -36,11 +36,10 @@ export default class NewListForm extends React.PureComponent {
|
|||
this.props.onChange(e.target.value);
|
||||
}
|
||||
|
||||
handleKeyUp = e => {
|
||||
if (e.keyCode === 13) {
|
||||
handleSubmit = e => {
|
||||
e.preventDefault();
|
||||
this.props.onSubmit();
|
||||
}
|
||||
}
|
||||
|
||||
handleClick = () => {
|
||||
this.props.onSubmit();
|
||||
|
@ -53,7 +52,7 @@ export default class NewListForm extends React.PureComponent {
|
|||
const title = intl.formatMessage(messages.title);
|
||||
|
||||
return (
|
||||
<div className='column-inline-form'>
|
||||
<form className='column-inline-form' onSubmit={this.handleSubmit}>
|
||||
<label>
|
||||
<span style={{ display: 'none' }}>{label}</span>
|
||||
|
||||
|
@ -62,7 +61,6 @@ export default class NewListForm extends React.PureComponent {
|
|||
value={value}
|
||||
disabled={disabled}
|
||||
onChange={this.handleChange}
|
||||
onKeyUp={this.handleKeyUp}
|
||||
placeholder={label}
|
||||
/>
|
||||
</label>
|
||||
|
@ -73,7 +71,7 @@ export default class NewListForm extends React.PureComponent {
|
|||
title={title}
|
||||
onClick={this.handleClick}
|
||||
/>
|
||||
</div>
|
||||
</form>
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -4467,6 +4467,10 @@ noscript {
|
|||
input {
|
||||
width: 100%;
|
||||
margin-bottom: 6px;
|
||||
|
||||
&:focus {
|
||||
outline: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue