From 1709e9487b91f5511a52a52e53a9072aae18f4a4 Mon Sep 17 00:00:00 2001 From: Olivier Tassinari Date: Fri, 27 Mar 2020 23:54:43 +0100 Subject: [PATCH] respect existing types --- .../material-ui-lab/src/useAutocomplete/useAutocomplete.js | 2 +- .../src/useAutocomplete/useAutocomplete.test.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/material-ui-lab/src/useAutocomplete/useAutocomplete.js b/packages/material-ui-lab/src/useAutocomplete/useAutocomplete.js index 65cf5d9002afe4..5e058d12693643 100644 --- a/packages/material-ui-lab/src/useAutocomplete/useAutocomplete.js +++ b/packages/material-ui-lab/src/useAutocomplete/useAutocomplete.js @@ -32,7 +32,7 @@ export function createFilterOptions(config = {}) { } if (startAfter > 0 && input.length <= startAfter) { - return false; + return []; } const filteredOptions = options.filter((option) => { diff --git a/packages/material-ui-lab/src/useAutocomplete/useAutocomplete.test.js b/packages/material-ui-lab/src/useAutocomplete/useAutocomplete.test.js index 3c745d49841d74..3718b6b421192a 100644 --- a/packages/material-ui-lab/src/useAutocomplete/useAutocomplete.test.js +++ b/packages/material-ui-lab/src/useAutocomplete/useAutocomplete.test.js @@ -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], ]);