diff --git a/src/components/views/dialogs/BugReportDialog.tsx b/src/components/views/dialogs/BugReportDialog.tsx index 319f7db817f..ed706f97c5b 100644 --- a/src/components/views/dialogs/BugReportDialog.tsx +++ b/src/components/views/dialogs/BugReportDialog.tsx @@ -53,9 +53,11 @@ interface IState { export default class BugReportDialog extends React.Component { private unmounted: boolean; + private issueRef: React.RefObject; public constructor(props: IProps) { super(props); + this.state = { sendLogs: true, busy: false, @@ -66,7 +68,9 @@ export default class BugReportDialog extends React.Component { downloadBusy: false, downloadProgress: null, }; + this.unmounted = false; + this.issueRef = React.createRef(); // Get all of the extra info dumped to the console when someone is about // to send debug logs. Since this is a fire and forget action, we do @@ -79,6 +83,10 @@ export default class BugReportDialog extends React.Component { }); } + public componentDidMount(): void { + this.issueRef.current?.focus(); + } + public componentWillUnmount(): void { this.unmounted = true; } @@ -255,6 +263,7 @@ export default class BugReportDialog extends React.Component { onChange={this.onIssueUrlChange} value={this.state.issueUrl} placeholder="https://github.com/vector-im/element-web/issues/..." + ref={this.issueRef} />