Skip to content

Instantly share code, notes, and snippets.

@A
Last active August 29, 2015 14:22
Show Gist options
  • Select an option

  • Save A/48abf0ff86bb358df74c to your computer and use it in GitHub Desktop.

Select an option

Save A/48abf0ff86bb358df74c to your computer and use it in GitHub Desktop.

Revisions

  1. A revised this gist Jun 8, 2015. 1 changed file with 6 additions and 1 deletion.
    7 changes: 6 additions & 1 deletion react-select.js
    Original file line number Diff line number Diff line change
    @@ -1 +1,6 @@
    return !filterValue || this.props.matchPos === 'start' ? this.props.matchProp !== 'label' && valueTest.toLowerCase().substr(0, filterValue.length) === filterValue || this.props.matchProp !== 'value' && labelTest.toLowerCase().substr(0, filterValue.length) === filterValue : this.props.matchProp !== 'label' && valueTest.toLowerCase().indexOf(filterValue.toLowerCase()) >= 0 || this.props.matchProp !== 'value' && labelTest.toLowerCase().indexOf(filterValue.toLowerCase()) >= 0;
    return !filterValue || this.props.matchPos === 'start'
    ? this.props.matchProp !== 'label'
    && valueTest.toLowerCase().substr(0, filterValue.length) === filterValue || this.props.matchProp !== 'value'
    && labelTest.toLowerCase().substr(0, filterValue.length) === filterValue
    : this.props.matchProp !== 'label' && valueTest.toLowerCase().indexOf(filterValue.toLowerCase()) >= 0
    || this.props.matchProp !== 'value' && labelTest.toLowerCase().indexOf(filterValue.toLowerCase()) >= 0;
  2. A created this gist Jun 8, 2015.
    1 change: 1 addition & 0 deletions react-select.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    return !filterValue || this.props.matchPos === 'start' ? this.props.matchProp !== 'label' && valueTest.toLowerCase().substr(0, filterValue.length) === filterValue || this.props.matchProp !== 'value' && labelTest.toLowerCase().substr(0, filterValue.length) === filterValue : this.props.matchProp !== 'label' && valueTest.toLowerCase().indexOf(filterValue.toLowerCase()) >= 0 || this.props.matchProp !== 'value' && labelTest.toLowerCase().indexOf(filterValue.toLowerCase()) >= 0;