修复input等有用户输入交互的组件, 因为value属性初值和终值都为空时, 刷新渲染不会清除输入内容的问题

master 1.11.5
yutent 2024-05-17 17:51:31 +08:00
parent c56013c9b4
commit 065271f2f6
2 changed files with 3 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "wkit", "name": "wkit",
"version": "1.11.4", "version": "1.11.5",
"type": "module", "type": "module",
"description": "A library for building fast, lightweight web components.", "description": "A library for building fast, lightweight web components.",
"main": "dist/index.js", "main": "dist/index.js",

View File

@ -548,7 +548,8 @@ class AttributePart {
this.#value[i] = v this.#value[i] = v
} }
} }
if (changed) { // value属性做特殊处理, 解决输入框无法清空的问题
if (changed || this.name === 'value') {
this.commitValue(value) this.commitValue(value)
} }
} }