Added auto focus to Github URL on opening of debug logs modal (#10479)
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>pull/28788/head^2
parent
5cd459ff2d
commit
f933806b63
|
@ -53,9 +53,11 @@ interface IState {
|
||||||
|
|
||||||
export default class BugReportDialog extends React.Component<IProps, IState> {
|
export default class BugReportDialog extends React.Component<IProps, IState> {
|
||||||
private unmounted: boolean;
|
private unmounted: boolean;
|
||||||
|
private issueRef: React.RefObject<Field>;
|
||||||
|
|
||||||
public constructor(props: IProps) {
|
public constructor(props: IProps) {
|
||||||
super(props);
|
super(props);
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
sendLogs: true,
|
sendLogs: true,
|
||||||
busy: false,
|
busy: false,
|
||||||
|
@ -66,7 +68,9 @@ export default class BugReportDialog extends React.Component<IProps, IState> {
|
||||||
downloadBusy: false,
|
downloadBusy: false,
|
||||||
downloadProgress: null,
|
downloadProgress: null,
|
||||||
};
|
};
|
||||||
|
|
||||||
this.unmounted = false;
|
this.unmounted = false;
|
||||||
|
this.issueRef = React.createRef();
|
||||||
|
|
||||||
// Get all of the extra info dumped to the console when someone is about
|
// 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
|
// 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> {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public componentDidMount(): void {
|
||||||
|
this.issueRef.current?.focus();
|
||||||
|
}
|
||||||
|
|
||||||
public componentWillUnmount(): void {
|
public componentWillUnmount(): void {
|
||||||
this.unmounted = true;
|
this.unmounted = true;
|
||||||
}
|
}
|
||||||
|
@ -255,6 +263,7 @@ export default class BugReportDialog extends React.Component<IProps, IState> {
|
||||||
onChange={this.onIssueUrlChange}
|
onChange={this.onIssueUrlChange}
|
||||||
value={this.state.issueUrl}
|
value={this.state.issueUrl}
|
||||||
placeholder="https://github.com/vector-im/element-web/issues/..."
|
placeholder="https://github.com/vector-im/element-web/issues/..."
|
||||||
|
ref={this.issueRef}
|
||||||
/>
|
/>
|
||||||
<Field
|
<Field
|
||||||
className="mx_BugReportDialog_field_input"
|
className="mx_BugReportDialog_field_input"
|
||||||
|
|
Loading…
Reference in New Issue