修复:手动改过输入框后,程序再把文字设回原值时输入框不刷新
浏览器把用户输入发给运行器时没有同步更新自己记下的 Text,运行器再设成同样的值时, 属性看起来没变,输入框不会刷新。现在发送输入时同步记下(文本框、可输入的下拉框); 评分驱动做同样处理。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
91b39603a2
commit
4ed9450c02
2 files changed
+7
No files matched your search
@@ -129,6 +129,8 @@ export class ProgramDriver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
act(node: ControlNode, action: UserAction) {
|
act(node: ControlNode, action: UserAction) {
|
||||||
|
// 和浏览器一样同步记下输入的文字(运行器不回传)
|
||||||
|
if (action.action === 'text') node.props.Text = action.value
|
||||||
this.send({ type: 'action', id: node.id, ...action })
|
this.send({ type: 'action', id: node.id, ...action })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -95,6 +95,11 @@ export function createRunSession() {
|
|||||||
|
|
||||||
function act(id: string, action: UserAction) {
|
function act(id: string, action: UserAction) {
|
||||||
actionSentAt = performance.now()
|
actionSentAt = performance.now()
|
||||||
|
// 输入的文字运行器不再回传,这里同步记下;否则程序再把 Text 设成原来的值时,属性"没变",输入框不会刷新
|
||||||
|
if (action.action === 'text') {
|
||||||
|
const node = nodes.get(id)
|
||||||
|
if (node) node.props.Text = action.value
|
||||||
|
}
|
||||||
send({ type: 'action', id, ...action } as ClientMessage)
|
send({ type: 'action', id, ...action } as ClientMessage)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user