Skip to content

Commit

Permalink
fix: Sort regular smart picker options first
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliusknorr authored and backportbot-nextcloud[bot] committed Aug 18, 2023
1 parent dffffa0 commit 1d32915
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/components/Suggestion/LinkPicker/suggestions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
}),
]
},
})

0 comments on commit 1d32915

Please sign in to comment.