Only focus on reply commentform textareas. Fixes #944
This commit is contained in:
parent
c87cacf6b6
commit
8ea0a0d60d
2 changed files with 6 additions and 1 deletions
5
ui/src/components/comment-form.tsx
vendored
5
ui/src/components/comment-form.tsx
vendored
|
@ -33,6 +33,7 @@ interface CommentFormProps {
|
|||
onReplyCancel?(): any;
|
||||
edit?: boolean;
|
||||
disabled?: boolean;
|
||||
focus?: boolean;
|
||||
}
|
||||
|
||||
interface CommentFormState {
|
||||
|
@ -122,7 +123,9 @@ export class CommentForm extends Component<CommentFormProps, CommentFormState> {
|
|||
setTimeout(() => autosize.update(textarea), 10);
|
||||
}
|
||||
|
||||
textarea.focus();
|
||||
if (this.props.focus) {
|
||||
textarea.focus();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
2
ui/src/components/comment-node.tsx
vendored
2
ui/src/components/comment-node.tsx
vendored
|
@ -229,6 +229,7 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
|
|||
edit
|
||||
onReplyCancel={this.handleReplyCancel}
|
||||
disabled={this.props.locked}
|
||||
focus
|
||||
/>
|
||||
)}
|
||||
{!this.state.showEdit && !this.state.collapsed && (
|
||||
|
@ -697,6 +698,7 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
|
|||
node={node}
|
||||
onReplyCancel={this.handleReplyCancel}
|
||||
disabled={this.props.locked}
|
||||
focus
|
||||
/>
|
||||
)}
|
||||
{node.children && !this.state.collapsed && (
|
||||
|
|
Loading…
Reference in a new issue