Skip to content

Commit

Permalink
Merge pull request #3248 from ingef/improve-multi-select-load-more-input
Browse files Browse the repository at this point in the history
Improve multi select load more input
  • Loading branch information
Kadrian authored Dec 11, 2023
2 parents afc7e5b + 402e87d commit 2c315b5
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,11 @@ const InputMultiSelect = ({
useDebounce(
() => {
if (onLoadMore && !loading) {
onLoadMore(inputValue, { shouldReset: true });
const prefix = inputValue.length < 2 ? "" : inputValue;
onLoadMore(prefix, { shouldReset: true });
}
},
200,
350,
[inputValue],
);

Expand Down Expand Up @@ -391,7 +392,9 @@ const InputMultiSelect = ({
<LoadMoreSentinel
onLoadMore={() => {
if (!loading) {
onLoadMore(inputValue);
const prefix =
inputValue.length < 2 ? "" : inputValue;
onLoadMore(prefix);
}
}}
/>
Expand Down

0 comments on commit 2c315b5

Please sign in to comment.