mirror of
https://github.com/outline/outline.git
synced 2026-12-01 17:32:49 +03:00
fix: Filtering in suggestion menu
This commit is contained in:
1 parent
8eb73b4079
commit
2ee8167cdc
2 files changed
+6
-1
No files matched your search
@@ -1,3 +1,4 @@
|
||||
import { isEmail } from "class-validator";
|
||||
import { observer } from "mobx-react";
|
||||
import { DocumentIcon, PlusIcon } from "outline-icons";
|
||||
import * as React from "react";
|
||||
@@ -129,7 +130,7 @@ function MentionMenu({ search, isActive, ...rest }: Props) {
|
||||
title: search?.trim(),
|
||||
section: DocumentsSection,
|
||||
subtitle: t("Create a new doc"),
|
||||
visible: !!search,
|
||||
visible: !!search && !isEmail(search),
|
||||
priority: -1,
|
||||
appendSpace: true,
|
||||
attrs: {
|
||||
|
||||
@@ -427,6 +427,10 @@ function SuggestionsMenu<T extends MenuItem>(props: Props<T>) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (item.visible === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Some extensions may be disabled, remove corresponding menu items
|
||||
if (
|
||||
item.name &&
|
||||
|
||||
Reference in new issue
Block a user