Comment box focus (#947)

* Add fallback url to fuse devserver(closes #945)

* Only focus on reply commentform textareas. Fixes #944

Co-authored-by: Justin Hernandez <jmarthernandez@gmail.com>
pull/954/head
Dessalines 4 years ago committed by GitHub
parent f3dbfcd37b
commit 74655de618
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

@ -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…
Cancel
Save