From 1d3291539e22e041c47fa2260c68147bc200d0c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Mon, 14 Aug 2023 16:14:39 +0200 Subject: [PATCH] fix: Sort regular smart picker options first MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- src/components/Suggestion/LinkPicker/suggestions.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/Suggestion/LinkPicker/suggestions.js b/src/components/Suggestion/LinkPicker/suggestions.js index fd9264aa212..402e8050766 100644 --- a/src/components/Suggestion/LinkPicker/suggestions.js +++ b/src/components/Suggestion/LinkPicker/suggestions.js @@ -79,12 +79,6 @@ export default () => createSuggestions({ }, items: ({ editor, query }) => { return [ - ...formattingSuggestions(query) - .filter(({ action, isActive }) => { - const canRunState = action(editor?.can()) - const isActiveState = isActive && getIsActive({ isActive }, editor) - return canRunState && !isActiveState - }), ...searchProvider(query) .map(p => { return { @@ -94,6 +88,12 @@ export default () => createSuggestions({ providerId: p.id, } }), + ...formattingSuggestions(query) + .filter(({ action, isActive }) => { + const canRunState = action(editor?.can()) + const isActiveState = isActive && getIsActive({ isActive }, editor) + return canRunState && !isActiveState + }), ] }, })