瀏覽代碼

restore contentEditable when cancelling format page

Gildas 5 年之前
父節點
當前提交
a16b1359ed
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      extension/ui/content/content-ui-editor-web.js

+ 4 - 2
extension/ui/content/content-ui-editor-web.js

@@ -1535,9 +1535,11 @@ table {
 		onUpdate(false);
 	}
 
-	function cancelFormatPage() {
+	async function cancelFormatPage() {
 		if (previousContent) {
-			init(previousContent);
+			const contentEditable = document.body.contentEditable;
+			await init(previousContent);
+			document.body.contentEditable = contentEditable;
 			previousContent = null;
 		}
 	}