提交 9d958136 编写于 作者: R Rachel Macfarlane

Set initial focus on an input field when opening the issue reporter

上级 ceaa95c0
......@@ -60,6 +60,7 @@ export function startup(configuration: IssueReporterConfiguration) {
const issueReporter = new IssueReporter(configuration);
issueReporter.render();
document.body.style.display = 'block';
issueReporter.setInitialFocus();
}
export class IssueReporter extends Disposable {
......@@ -142,6 +143,21 @@ export class IssueReporter extends Disposable {
this.renderBlocks();
}
setInitialFocus() {
const { fileOnExtension } = this.issueReporterModel.getData();
if (fileOnExtension) {
const issueTitle = document.getElementById('issue-title');
if (issueTitle) {
issueTitle.focus();
}
} else {
const issueType = document.getElementById('issue-type');
if (issueType) {
issueType.focus();
}
}
}
private applyZoom(zoomLevel: number) {
webFrame.setZoomLevel(zoomLevel);
browser.setZoomFactor(webFrame.getZoomFactor());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册