fix(editor): preserve tag name updates on modifying tag color (#11744)

This commit is contained in:
Xun Sun
2025-04-24 10:09:17 +08:00
committed by GitHub
parent 3b4fcbd526
commit 8ea0d78862

View File

@@ -72,7 +72,7 @@ export type TagManagerOptions = {
};
class TagManager {
changeTag = (option: SelectTag) => {
changeTag = (option: Partial<SelectTag>) => {
this.ops.onOptionsChange(
this.ops.options.value.map(item => {
if (item.id === option.id) {
@@ -207,7 +207,7 @@ export class MultiTagSelect extends SignalWatcher(
initialValue: option.value,
onChange: text => {
this.tagManager.changeTag({
...option,
id: option.id,
value: text,
});
},
@@ -237,7 +237,7 @@ export class MultiTagSelect extends SignalWatcher(
isSelected: option.color === item.color,
select: () => {
this.tagManager.changeTag({
...option,
id: option.id,
color: item.color,
});
},