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

Commit f933806

Browse files
ShivamSpmt3chguy
andauthored
Added auto focus to Github URL on opening of debug logs modal (#10479)
Co-authored-by: Michael Telatynski <[email protected]>
1 parent 5cd459f commit f933806

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/components/views/dialogs/BugReportDialog.tsx

+9
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,11 @@ interface IState {
5353

5454
export default class BugReportDialog extends React.Component<IProps, IState> {
5555
private unmounted: boolean;
56+
private issueRef: React.RefObject<Field>;
5657

5758
public constructor(props: IProps) {
5859
super(props);
60+
5961
this.state = {
6062
sendLogs: true,
6163
busy: false,
@@ -66,7 +68,9 @@ export default class BugReportDialog extends React.Component<IProps, IState> {
6668
downloadBusy: false,
6769
downloadProgress: null,
6870
};
71+
6972
this.unmounted = false;
73+
this.issueRef = React.createRef();
7074

7175
// Get all of the extra info dumped to the console when someone is about
7276
// 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<IProps, IState> {
7983
});
8084
}
8185

86+
public componentDidMount(): void {
87+
this.issueRef.current?.focus();
88+
}
89+
8290
public componentWillUnmount(): void {
8391
this.unmounted = true;
8492
}
@@ -255,6 +263,7 @@ export default class BugReportDialog extends React.Component<IProps, IState> {
255263
onChange={this.onIssueUrlChange}
256264
value={this.state.issueUrl}
257265
placeholder="https://github.com/vector-im/element-web/issues/..."
266+
ref={this.issueRef}
258267
/>
259268
<Field
260269
className="mx_BugReportDialog_field_input"

0 commit comments

Comments
 (0)