Fix choices

This commit is contained in:
shanexi
2024-10-16 12:08:51 +08:00
parent 4e929fdc1b
commit 46e6b3ff91
+4 -7
View File
@@ -55,8 +55,8 @@ app.registerExtension({
if (["ShellAgentPluginInputText", "ShellAgentPluginInputFloat"].indexOf(nodeData.name) > -1) {
chainCallback(nodeType.prototype, "onNodeCreated", function () {
const widget = this.addWidget("combo", "choices", presets[0], () => { }, {
values: presets,
const widget = this.addWidget("string", "choices", presets, () => { }, {
value: presets,
});
this.addWidget('button', 'manage choices', null, () => {
@@ -131,11 +131,8 @@ app.registerExtension({
p.push(v.value);
}
widget.options.values = p;
if (!widget.options.values.includes(widget.value)) {
widget.value = widget.options.values[0];
}
widget.value = p;
presets = p;
localStorage.setItem(id, JSON.stringify(presets));