MCPcopy Index your code
hub / github.com/primer/react / getDefaultSortFn

Function getDefaultSortFn

packages/react/src/Autocomplete/AutocompleteMenu.tsx:23–24  ·  view source on GitHub ↗
(isItemSelectedFn: (itemId: string) => boolean)

Source from the content-addressed store, hash-verified

21}
22
23const getDefaultSortFn = (isItemSelectedFn: (itemId: string) => boolean) => (itemIdA: string, itemIdB: string) =>
24 isItemSelectedFn(itemIdA) === isItemSelectedFn(itemIdB) ? 0 : isItemSelectedFn(itemIdA) ? -1 : 1
25const menuScrollMargins: ScrollIntoViewOptions = {startMargin: 0, endMargin: 8}
26
27function getDefaultItemFilter<T extends AutocompleteMenuItem>(filterValue: string) {

Callers 1

AutocompleteMenuFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected