Skip to content

AsyncTypeahead - useCache not working #520

@jbialobr

Description

@jbialobr

Version

3.4.5

Steps to reproduce

        <AsyncTypeahead
          isLoading={this.state.isLoading}
          options={this.state.options}
          minLength={3}
          useCache={true}
          onSearch={query =>
          {
            this.setState({ isLoading: true });
            this.props.service.searchContracts(query, 20).then(res =>
              this.setState({ isLoading: false, options: res?.map(o => o.number + this.contractInfo(o)) ?? [] }));
          }}
          placeholder="Wpisz fragment numeru umowy"
        />

Typing first 3 letters:
image

Typing the 4th letter:
image

Typing more letters:
image

One more letter:
image

Expected Behavior

For all the above substrings it should find a match.

Actual Behavior

It fails to find a match at random prefixes.
It works fine if useCache is disabled.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions