mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 12:55:00 +00:00
feat(core): allow keyboard navigation in tags inline editor (#7378)
fix AF-966 - Allow using arrowup/down to navigate the tag list candidates; press enter to add the currently focused tag option; - Allow using arrowleft/right to navigate the inline tag list (selected) and use backspace to delete focused tag.
This commit is contained in:
@@ -63,12 +63,6 @@ export class TagList extends Entity {
|
||||
return trimmedValue.includes(trimmedQuery);
|
||||
}
|
||||
|
||||
private findfn(value: string, query?: string) {
|
||||
const trimmedTagValue = query?.trim().toLowerCase();
|
||||
const trimmedInputValue = value.trim().toLowerCase();
|
||||
return trimmedTagValue === trimmedInputValue;
|
||||
}
|
||||
|
||||
filterTagsByName$(name: string) {
|
||||
return LiveData.computed(get => {
|
||||
return get(this.tags$).filter(tag =>
|
||||
@@ -76,16 +70,4 @@ export class TagList extends Entity {
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
tagByTagValue$(value: string) {
|
||||
return LiveData.computed(get => {
|
||||
return get(this.tags$).find(tag => this.filterFn(get(tag.value$), value));
|
||||
});
|
||||
}
|
||||
|
||||
excactTagByValue$(value: string) {
|
||||
return LiveData.computed(get => {
|
||||
return get(this.tags$).find(tag => this.findfn(get(tag.value$), value));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user