Skip to content

Commit

Permalink
Show select items in a filtered multi select. This is inconsistent wi…
Browse files Browse the repository at this point in the history
…th react-select but is less annoying to use.
  • Loading branch information
jameswilddev committed Nov 25, 2021
1 parent 16b9ad0 commit 8be4894
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,8 @@ export const createSearchableMultiSelectChildrenComponent = <
let filteredOptions;

if (normalizedFilter) {
filteredOptions = sortedOptions.filter(
({ label, value }) =>
!values.includes(value) && normalize(label).includes(normalizedFilter)
filteredOptions = sortedOptions.filter(({ label }) =>
normalize(label).includes(normalizedFilter)
);
} else {
filteredOptions = sortedOptions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ test(`renders as expected without a filter`, () => {
expect(stub).not.toHaveBeenCalled();
});

test(`filters the list down to only those unselected and matching the user's input`, () => {
test(`filters the list down to only those matching the user's input`, () => {
const Component = createSearchableMultiSelectChildrenComponent<TestValue>({
fontFamily: `Example Font Family`,
fontSize: 37,
Expand Down

0 comments on commit 8be4894

Please sign in to comment.