Skip to content

Commit

Permalink
respect existing types
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Mar 27, 2020
1 parent cfd715f commit 1709e94
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function createFilterOptions(config = {}) {
}

if (startAfter > 0 && input.length <= startAfter) {
return false;
return [];
}

const filteredOptions = options.filter((option) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ describe('createFilterOptions', () => {
},
];

expect(filterOptions(options, { inputValue: 'c', getOptionLabel })).to.deep.equal(false);
expect(filterOptions(options, { inputValue: 'ca', getOptionLabel })).to.deep.equal(false);
expect(filterOptions(options, { inputValue: 'c', getOptionLabel })).to.deep.equal([]);
expect(filterOptions(options, { inputValue: 'ca', getOptionLabel })).to.deep.equal([]);
expect(filterOptions(options, { inputValue: 'cat', getOptionLabel })).to.deep.equal([
options[0],
]);
Expand Down

0 comments on commit 1709e94

Please sign in to comment.