|
@@ -240,7 +240,7 @@ function Menu({
|
|
// emptyHidesInput is set to true.
|
|
// emptyHidesInput is set to true.
|
|
const showInput = !hideInput && (hasItems || !emptyHidesInput);
|
|
const showInput = !hideInput && (hasItems || !emptyHidesInput);
|
|
|
|
|
|
- // Only redefine the autocomplete function if our items list has chagned.
|
|
|
|
|
|
+ // Only redefine the autocomplete function if our items list has changed.
|
|
// This avoids producing a new array on every call.
|
|
// This avoids producing a new array on every call.
|
|
const stableItemFilter = useCallback(
|
|
const stableItemFilter = useCallback(
|
|
(filterValueOrInput: string) => autoCompleteFilter(items, filterValueOrInput),
|
|
(filterValueOrInput: string) => autoCompleteFilter(items, filterValueOrInput),
|
|
@@ -295,7 +295,7 @@ function Menu({
|
|
!busy && !busyItemsStillVisible && filterValueOrInput && !hasResults;
|
|
!busy && !busyItemsStillVisible && filterValueOrInput && !hasResults;
|
|
|
|
|
|
// When virtualization is turned on, we need to pass in the number of
|
|
// When virtualization is turned on, we need to pass in the number of
|
|
- // selecteable items for arrow-key limits
|
|
|
|
|
|
+ // selectable items for arrow-key limits
|
|
const itemCount = virtualizedHeight
|
|
const itemCount = virtualizedHeight
|
|
? autoCompleteResults.filter(i => !i.groupLabel).length
|
|
? autoCompleteResults.filter(i => !i.groupLabel).length
|
|
: undefined;
|
|
: undefined;
|