소스 검색

fix focus issue on first display in Firefox

Gildas 5 년 전
부모
커밋
da02a4acc3
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      extension/ui/bg/ui-editor.js

+ 1 - 1
extension/ui/bg/ui-editor.js

@@ -76,7 +76,6 @@ singlefile.extension.ui.bg.editor = (() => {
 	addPinkNoteButton.onclick = () => editorElement.contentWindow.postMessage(JSON.stringify({ method: "addNote", color: "note-pink" }), "*");
 	addBlueNoteButton.onclick = () => editorElement.contentWindow.postMessage(JSON.stringify({ method: "addNote", color: "note-blue" }), "*");
 	addGreenNoteButton.onclick = () => editorElement.contentWindow.postMessage(JSON.stringify({ method: "addNote", color: "note-green" }), "*");
-	editorElement.contentWindow.focus();
 	document.onclick = () => editorElement.contentWindow.focus();
 	highlightButtons.forEach(highlightButton => {
 		highlightButton.onclick = () => {
@@ -269,6 +268,7 @@ singlefile.extension.ui.bg.editor = (() => {
 					tabData.docSaved = true;
 					tabDataContents = [];
 					editorElement.contentWindow.postMessage(JSON.stringify({ method: "init", content: tabData.content }), "*");
+					editorElement.contentWindow.focus();
 					delete tabData.content;
 				}
 				return Promise.resolve({});