Permalink
Browse files

Document the undocumented `ignoreAccents` property

  • Loading branch information...
dmatteo committed Dec 27, 2016
1 parent ef3a468 commit 13444bdd8c5d5886ca53dcd3cee49ce8330cbec4
Showing with 5 additions and 2 deletions.
  1. +5 −2 README.md
View
@@ -250,16 +250,18 @@ You can control how options are filtered with the following properties:
* `matchPos`: `"start"` or `"any"`: whether to match the text entered at the start or any position in the option value
* `matchProp`: `"label"`, `"value"` or `"any"`: whether to match the value, label or both values of each option when filtering
* `ignoreCase`: `Boolean`: whether to ignore case or match the text exactly when filtering
* `ignoreAccents`: `Boolean`: whether to ignore accents on characters like ø or å
`matchProp` and `matchPos` both default to `"any"`.
`ignoreCase` defaults to `true`.
`ignoreAccents` defaults to `true`.
#### Advanced filters
You can also completely replace the method used to filter either a single option, or the entire options array (allowing custom sort mechanisms, etc.)
* `filterOption`: `function(Object option, String filter)` returns `Boolean`. Will override `matchPos`, `matchProp` and `ignoreCase` options.
* `filterOptions`: `function(Array options, String filter, Array currentValues)` returns `Array filteredOptions`. Will override `filterOption`, `matchPos`, `matchProp` and `ignoreCase` options.
* `filterOption`: `function(Object option, String filter)` returns `Boolean`. Will override `matchPos`, `matchProp`, `ignoreCase` and `ignoreAccents` options.
* `filterOptions`: `function(Array options, String filter, Array currentValues)` returns `Array filteredOptions`. Will override `filterOption`, `matchPos`, `matchProp`, `ignoreCase` and `ignoreAccents` options.
For multi-select inputs, when providing a custom `filterOptions` method, remember to exclude current values from the returned array of options.
@@ -357,6 +359,7 @@ function onInputKeyDown(event) {
disabled | bool | false | whether the Select is disabled or not
filterOption | func | undefined | method to filter a single option: `function(option, filterString)`
filterOptions | func | undefined | method to filter the options array: `function([options], filterString, [values])`
ignoreAccents | bool | true | whether to strip accents when filtering
ignoreCase | bool | true | whether to perform case-insensitive filtering
inputProps | object | {} | custom attributes for the Input (in the Select-control) e.g: `{'data-foo': 'bar'}`
isLoading | bool | false | whether the Select is loading externally or not (such as options being loaded)

0 comments on commit 13444bd

Please sign in to comment.