fix: SDK 收集输入框字符时同时包含 placeholder 占位文本

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
崮生(子虚) 2026-04-30 21:39:47 +08:00
parent 7c7db7447a
commit 106eb8ce7b

View File

@ -149,7 +149,10 @@ var WebFont = (function () {
function getText(el) {
var tag = el.tagName;
if (tag === "INPUT" || tag === "TEXTAREA" || tag === "SELECT") {
return el.value || "";
/** 同时收集 value 和 placeholder确保占位文本的字体也被加载 */
var val = el.value || "";
var ph = el.placeholder || "";
return val + ph;
}
return el.textContent || "";
}