mirror of
https://github.com/2234839/web-font.git
synced 2026-05-06 19:08:11 +08:00
fix: SDK 收集输入框字符时同时包含 placeholder 占位文本
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
7c7db7447a
commit
106eb8ce7b
@ -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 || "";
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user