mirror of https://github.com/LemmyNet/lemmy.git
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
parent
f3dbfcd37b
commit
74655de618
|
@ -33,6 +33,7 @@ interface CommentFormProps {
|
||||||
onReplyCancel?(): any;
|
onReplyCancel?(): any;
|
||||||
edit?: boolean;
|
edit?: boolean;
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
|
focus?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface CommentFormState {
|
interface CommentFormState {
|
||||||
|
@ -122,9 +123,11 @@ export class CommentForm extends Component<CommentFormProps, CommentFormState> {
|
||||||
setTimeout(() => autosize.update(textarea), 10);
|
setTimeout(() => autosize.update(textarea), 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.props.focus) {
|
||||||
textarea.focus();
|
textarea.focus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
componentDidUpdate() {
|
componentDidUpdate() {
|
||||||
if (this.state.commentForm.content) {
|
if (this.state.commentForm.content) {
|
||||||
|
|
|
@ -229,6 +229,7 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
|
||||||
edit
|
edit
|
||||||
onReplyCancel={this.handleReplyCancel}
|
onReplyCancel={this.handleReplyCancel}
|
||||||
disabled={this.props.locked}
|
disabled={this.props.locked}
|
||||||
|
focus
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{!this.state.showEdit && !this.state.collapsed && (
|
{!this.state.showEdit && !this.state.collapsed && (
|
||||||
|
@ -697,6 +698,7 @@ export class CommentNode extends Component<CommentNodeProps, CommentNodeState> {
|
||||||
node={node}
|
node={node}
|
||||||
onReplyCancel={this.handleReplyCancel}
|
onReplyCancel={this.handleReplyCancel}
|
||||||
disabled={this.props.locked}
|
disabled={this.props.locked}
|
||||||
|
focus
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{node.children && !this.state.collapsed && (
|
{node.children && !this.state.collapsed && (
|
||||||
|
|
Loading…
Reference in New Issue