Skip to content

Filtering broken for Combobox/Autocomplete with itemToString #930

@Procrat

Description

@Procrat

Summary

Filtering doesn't work for a Combobox (and presumably also Autocomplete) with itemToString.

Steps to reproduce

import React from 'react';
import { Combobox } from 'evergreen-ui';

export default () => (
  <Combobox
    items={[{label: 'label'}]}
    itemToString={item => item ? item.label : ''}
  />
);

Expected behaviour

When typing in a substring of "label", I expect the "label" item to show.

Observed behaviour

It doesn't.

Underlying issue

The V5 commit (731e46e) moved the assignment to itemsFilter around to a place where itemToString isn't defined yet. It has an obvious fix, so I'll make a PR for it.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions