mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-23 21:06:22 +08:00
fix(editor): preserve tag name updates on modifying tag color (#11744)
This commit is contained in:
@@ -72,7 +72,7 @@ export type TagManagerOptions = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
class TagManager {
|
class TagManager {
|
||||||
changeTag = (option: SelectTag) => {
|
changeTag = (option: Partial<SelectTag>) => {
|
||||||
this.ops.onOptionsChange(
|
this.ops.onOptionsChange(
|
||||||
this.ops.options.value.map(item => {
|
this.ops.options.value.map(item => {
|
||||||
if (item.id === option.id) {
|
if (item.id === option.id) {
|
||||||
@@ -207,7 +207,7 @@ export class MultiTagSelect extends SignalWatcher(
|
|||||||
initialValue: option.value,
|
initialValue: option.value,
|
||||||
onChange: text => {
|
onChange: text => {
|
||||||
this.tagManager.changeTag({
|
this.tagManager.changeTag({
|
||||||
...option,
|
id: option.id,
|
||||||
value: text,
|
value: text,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -237,7 +237,7 @@ export class MultiTagSelect extends SignalWatcher(
|
|||||||
isSelected: option.color === item.color,
|
isSelected: option.color === item.color,
|
||||||
select: () => {
|
select: () => {
|
||||||
this.tagManager.changeTag({
|
this.tagManager.changeTag({
|
||||||
...option,
|
id: option.id,
|
||||||
color: item.color,
|
color: item.color,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user