From f4ac55ec79457772f3ad1b0f983b9c1c06947caf Mon Sep 17 00:00:00 2001 From: mertsincan Date: Fri, 17 Apr 2020 12:26:56 +0300 Subject: [PATCH] Fixed #1336 - Add filterLocale property to MultiSelect --- src/components/multiselect/MultiSelect.d.ts | 1 + src/components/multiselect/MultiSelect.js | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/multiselect/MultiSelect.d.ts b/src/components/multiselect/MultiSelect.d.ts index 3c221d7810..f540eaf762 100755 --- a/src/components/multiselect/MultiSelect.d.ts +++ b/src/components/multiselect/MultiSelect.d.ts @@ -18,6 +18,7 @@ interface MultiSelectProps { filterBy?: string; filterMatchMode?: string; filterPlaceholder?: string; + filterLocale?: string; tabIndex?: boolean; dataKey?: string; inputId?: string; diff --git a/src/components/multiselect/MultiSelect.js b/src/components/multiselect/MultiSelect.js index 2f89e28419..bc25ca67da 100644 --- a/src/components/multiselect/MultiSelect.js +++ b/src/components/multiselect/MultiSelect.js @@ -28,6 +28,7 @@ export class MultiSelect extends Component { filterBy: null, filterMatchMode: 'contains', filterPlaceholder: null, + filterLocale: undefined, tabIndex: '0', dataKey: null, inputId: null, @@ -62,6 +63,7 @@ export class MultiSelect extends Component { filterBy: PropTypes.string, filterMatchMode: PropTypes.string, filterPlaceholder: PropTypes.string, + filterLocale: PropTypes.string, tabIndex: PropTypes.string, dataKey: PropTypes.string, inputId: PropTypes.string, @@ -373,9 +375,9 @@ export class MultiSelect extends Component { } filterOptions(options) { - let filterValue = this.state.filter.trim().toLowerCase(); + let filterValue = this.state.filter.trim().toLocaleLowerCase(this.props.filterLocale); let searchFields = this.props.filterBy ? this.props.filterBy.split(',') : [this.props.optionLabel || 'label']; - return FilterUtils.filter(options, searchFields, filterValue, this.props.filterMatchMode); + return FilterUtils.filter(options, searchFields, filterValue, this.props.filterMatchMode, this.props.filterLocale); } getOptionLabel(option) {