Skip to content

Commit a4af806

Browse files
committed
make one unified options for saving
1 parent 47aeb17 commit a4af806

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

client/packages/lowcoder/src/comps/comps/tagsComp/tagsCompView.tsx

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -419,8 +419,6 @@ const multiTags = (function () {
419419
export const MultiTagsComp = withExposingConfigs(
420420
multiTags,
421421
[
422-
new NameConfig("options", "Current tags array"),
423-
new NameConfig("runtimeOptions", "Runtime tags array"),
424422
depsConfig({
425423
name: "selectedTag",
426424
desc: "Currently selected tag data",
@@ -441,7 +439,7 @@ export const MultiTagsComp = withExposingConfigs(
441439
func: (input) => input.selectedTagIndex
442440
}),
443441
depsConfig({
444-
name: "selectedTagLabel",
442+
name: "selectedTagLabel",
445443
desc: "Label of currently selected tag",
446444
depKeys: ["selectedTagIndex", "runtimeOptions"],
447445
func: (input) => {
@@ -452,6 +450,22 @@ export const MultiTagsComp = withExposingConfigs(
452450
}
453451
return "";
454452
}
453+
}),
454+
depsConfig({
455+
name: "options",
456+
desc: "Current tags array (updates based on editable prop)",
457+
depKeys: ["options", "runtimeOptions", "editable"],
458+
func: (input) => {
459+
const { editable, options, runtimeOptions } = input;
460+
461+
// If not editable, always use the original props.options
462+
if (!editable) {
463+
return Array.isArray(options) ? options : [];
464+
}
465+
466+
// If editable, use runtimeOptions (user modifications)
467+
return Array.isArray(runtimeOptions) ? runtimeOptions : [];
468+
}
455469
})
456470
]
457471
);

0 commit comments

Comments
 (0)