瀏覽代碼

fixed option selection issue

Gildas 7 年之前
父節點
當前提交
9e6407353e
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      lib/single-file/single-file-core.js

+ 1 - 1
lib/single-file/single-file-core.js

@@ -327,7 +327,7 @@ this.SingleFileCore = this.SingleFileCore || (() => {
 			});
 			});
 			this.doc.querySelectorAll("select").forEach(select => {
 			this.doc.querySelectorAll("select").forEach(select => {
 				select.querySelectorAll("option").forEach(option => {
 				select.querySelectorAll("option").forEach(option => {
-					const selected = option.getAttribute(DOM.inputValueAttributeName(this.options.sessionId)) !== undefined;
+					const selected = option.getAttribute(DOM.inputValueAttributeName(this.options.sessionId)) != null;
 					if (selected) {
 					if (selected) {
 						option.setAttribute("selected", "");
 						option.setAttribute("selected", "");
 					}
 					}