Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Added auto focus to Github URL on opening of debug logs modal #10479

9 changes: 8 additions & 1 deletion src/components/views/dialogs/BugReportDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@ interface IState {

export default class BugReportDialog extends React.Component<IProps, IState> {
private unmounted: boolean;

private issueRef: any;
t3chguy marked this conversation as resolved.
Show resolved Hide resolved
public constructor(props: IProps) {
super(props);
this.issueRef = React.createRef();
this.state = {
sendLogs: true,
busy: false,
Expand All @@ -66,6 +67,7 @@ export default class BugReportDialog extends React.Component<IProps, IState> {
downloadBusy: false,
downloadProgress: null,
};

this.unmounted = false;

// Get all of the extra info dumped to the console when someone is about
Expand All @@ -79,6 +81,10 @@ export default class BugReportDialog extends React.Component<IProps, IState> {
});
}

public componentDidMount(): void {
this.issueRef.current?.focus();
}

public componentWillUnmount(): void {
this.unmounted = true;
}
Expand Down Expand Up @@ -255,6 +261,7 @@ export default class BugReportDialog extends React.Component<IProps, IState> {
onChange={this.onIssueUrlChange}
value={this.state.issueUrl}
placeholder="https://github.com/vector-im/element-web/issues/..."
ref={this.issueRef}
/>
<Field
className="mx_BugReportDialog_field_input"
Expand Down