Skip to content

Commit

Permalink
Fix weird filter output
Browse files Browse the repository at this point in the history
  • Loading branch information
lookacat committed Apr 19, 2023
1 parent 3319661 commit 54803d0
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ export default defineComponent({
const members = computed(() => {
if (group) {
return unref(group)
.members.sort((a, b) => a.displayName.localeCompare(b.displayName))
.map((u) => ({ ...u, kind: 'user' }))
return unref(group).members.sort((a, b) => a.displayName.localeCompare(b.displayName))
}
return []
})
Expand All @@ -64,7 +62,8 @@ export default defineComponent({
if (unref(membersListRef)) {
markInstance.value = new Mark(unref(membersListRef))
unref(markInstance).unmark()
unref(markInstance).mark(unref(filterTerm), {
const searchTermRegex = new RegExp(`\\b${unref(filterTerm)}\\b`, 'gi')
unref(markInstance).markRegExp(searchTermRegex, {
element: 'span',
className: 'highlight-mark'
})
Expand Down

0 comments on commit 54803d0

Please sign in to comment.