fix: prioritize persisted input values over spec defaults - #110
Merged
wang-kaopu merged 2 commits intoSep 6, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更说明
修复
InputNode中持久化字段值与 spec 默认值的优先级问题。此前当 input 同时包含
id和value时,即使用户修改后的值已经持久化,组件重新挂载后仍会优先使用node.value,并在 mount 阶段再次将默认值写回fields,导致用户已保存的值被覆盖。本 PR 调整为:
fields[id]node.value测试
新增回归测试,覆盖以下场景:
该修改也使
InputNode的恢复语义与现有SelectNode/SliderNode更一致。关联
为 #103 中
inputType: "color"的字段持久化场景提供正确的基础行为。