mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-14 17:41:33 +03:00
interface: remove duplicate result for exact query
This commit is contained in:
parent
c29a540fea
commit
8338bf7ac8
@ -118,7 +118,10 @@ export function DropdownSearch<C>(props: DropdownSearchProps<C>) {
|
|||||||
|
|
||||||
const dropdown = useMemo(() => {
|
const dropdown = useMemo(() => {
|
||||||
const first = props.isExact(query);
|
const first = props.isExact(query);
|
||||||
const opts = first ? [first, ...options] : options;
|
let opts = options;
|
||||||
|
if (first) {
|
||||||
|
opts = options.includes(first) ? opts : [first, ...options];
|
||||||
|
}
|
||||||
return _.take(opts, 5).map((o, idx) =>
|
return _.take(opts, 5).map((o, idx) =>
|
||||||
props.renderCandidate(
|
props.renderCandidate(
|
||||||
o,
|
o,
|
||||||
|
Loading…
Reference in New Issue
Block a user