How to use the react-md/lib/Autocompletes.caseInsensitiveFilter function in react-md

To help you get started, we’ve selected a few react-md examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mlaursen / react-md / docs / src / examples / autocompletes / MenuAutocomplete.jsx View on Github external
_handleFilterChange = (value) => {
    let filterType;
    switch (value) { // eslint-disable-line default-case
      case 'case':
        filterType = Autocomplete.caseInsensitiveFilter;
        break;
      case 'fuzzy':
        filterType = Autocomplete.fuzzyFilter;
        break;
      case 'fuse':
        filterType = this._fuseJSFilter;
        break;
    }

    this.setState({ filterType });
  };
github mlaursen / react-md / docs / src / examples / autocompletes / MenuAutocomplete.jsx View on Github external
constructor(props) {
    super(props);

    this.state = {
      filterType: Autocomplete.caseInsensitiveFilter,
    };
  }
github mlaursen / react-md / documentation / src / components / Components / autocompletes / MenuAutocomplete.jsx View on Github external
constructor(props) {
    super(props);

    this.state = {
      filterType: Autocomplete.caseInsensitiveFilter,
    };

    this.indexer = new Fuse(sampleData.map(lang => ({ primaryText: lang })), {
      keys: [{ name: 'primaryText', weight: 1 }],
    });
  }
github mlaursen / react-md / documentation / src / components / Components / autocompletes / MenuAutocomplete.jsx View on Github external
handleChange = (value) => {
    let { filterType } = this.state;
    switch (value) {
      case controls[0].value:
        filterType = Autocomplete.caseInsensitiveFilter;
        break;
      case controls[1].value:
        filterType = Autocomplete.fuzzyFilter;
        break;
      case controls[2].value:
        filterType = this.filterWithFuseJS;
        break;
      default:
        filterType = Autocomplete.caseInsensitiveFilter;
    }

    if (this.state.filterType !== filterType) {
      this.setState({ filterType });
    }
  };