fix(attestation): multiple tags improvements
- no menu when no matching tags - insert a space after clicking a button - allow no space before mention
This commit is contained in:
parent
58064dc6cd
commit
6f49dd892d
4 changed files with 19 additions and 4 deletions
|
@ -88,6 +88,11 @@ class SuggestionMenu {
|
|||
}
|
||||
|
||||
private render() {
|
||||
if (this.#props.items.length == 0) {
|
||||
this.#element?.remove();
|
||||
return;
|
||||
}
|
||||
|
||||
this.#element ??= this.createMenu();
|
||||
const list = this.#element.firstChild as HTMLUListElement;
|
||||
|
||||
|
@ -161,6 +166,7 @@ export function createSuggestionMenu(
|
|||
): Omit<SuggestionOptions<TagSchema>, 'editor'> {
|
||||
return {
|
||||
char: '@',
|
||||
allowedPrefixes: null,
|
||||
allowSpaces: true,
|
||||
items: ({ query }) => {
|
||||
return matchSorter(tags, query, { keys: ['label'] }).slice(0, 6);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue