瀏覽代碼

Handle submit event of new list form (#5895)

master
Yamagishi Kazutoshi 6 年之前
committed by Eugen Rochko
父節點
當前提交
a9ca5ce920
共有 2 個文件被更改,包括 9 次插入7 次删除
  1. +5
    -7
      app/javascript/mastodon/features/lists/components/new_list_form.js
  2. +4
    -0
      app/javascript/styles/mastodon/components.scss

+ 5
- 7
app/javascript/mastodon/features/lists/components/new_list_form.js 查看文件

@@ -36,10 +36,9 @@ export default class NewListForm extends React.PureComponent {
this.props.onChange(e.target.value);
}

handleKeyUp = e => {
if (e.keyCode === 13) {
this.props.onSubmit();
}
handleSubmit = e => {
e.preventDefault();
this.props.onSubmit();
}

handleClick = () => {
@@ -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>
);
}



+ 4
- 0
app/javascript/styles/mastodon/components.scss 查看文件

@@ -4467,6 +4467,10 @@ noscript {
input {
width: 100%;
margin-bottom: 6px;

&:focus {
outline: 0;
}
}
}



Loading…
取消
儲存