diff --git a/packages/common/src/dual-list-select/dual-list-select.js b/packages/common/src/dual-list-select/dual-list-select.js index 4fae1dc41..6955fb48a 100644 --- a/packages/common/src/dual-list-select/dual-list-select.js +++ b/packages/common/src/dual-list-select/dual-list-select.js @@ -40,20 +40,18 @@ const DualListSelectCommon = (props) => { const leftValues = rest.options .filter((option) => { - if (!props.isFilterCaseInSensitive){ + if (!props.isFilterCaseInSensitive) { return !rest.input.value.includes(option.value) && option.label.includes(state.filterOptions); - } - else{ + } else { return !rest.input.value.includes(option.value) && option.label.toLowerCase().includes(state.filterOptions.toLowerCase()); } }) .sort((a, b) => (state.sortLeftDesc ? a.label.localeCompare(b.label) : b.label.localeCompare(a.label))); const rightValues = rest.options .filter((option) => { - if (!props.isFilterCaseInSensitive){ + if (!props.isFilterCaseInSensitive) { return rest.input.value.includes(option.value) && option.label.includes(state.filterValue); - } - else{ + } else { return rest.input.value.includes(option.value) && option.label.toLowerCase().includes(state.filterValue.toLowerCase()); } }) diff --git a/packages/mui-component-mapper/src/dual-list-select/dual-list-select.d.ts b/packages/mui-component-mapper/src/dual-list-select/dual-list-select.d.ts index e695b05e0..52a1c3ae7 100644 --- a/packages/mui-component-mapper/src/dual-list-select/dual-list-select.d.ts +++ b/packages/mui-component-mapper/src/dual-list-select/dual-list-select.d.ts @@ -48,6 +48,7 @@ interface InternalDualListSelectProps { id?: string; leftValues?: DualListOption[]; rightValues?: DualListOption[]; + isFilterCaseInSensitive?: boolean; FormFieldGridProps?: GridProps; InternalGridProps?: GridProps; ListGridProps?: GridProps; diff --git a/packages/mui-component-mapper/src/dual-list-select/dual-list-select.js b/packages/mui-component-mapper/src/dual-list-select/dual-list-select.js index 0f6ae2ae8..fb0d00bbe 100644 --- a/packages/mui-component-mapper/src/dual-list-select/dual-list-select.js +++ b/packages/mui-component-mapper/src/dual-list-select/dual-list-select.js @@ -555,6 +555,7 @@ DualListSelect.propTypes = { rightValues: PropTypes.array, handleValuesClick: PropTypes.func, isFilterable: PropTypes.bool, + isFilterCaseInSensitive: PropTypes.bool, // props FormFieldGridProps: PropTypes.object, InternalGridProps: PropTypes.object, diff --git a/packages/react-renderer-demo/src/doc-components/examples-texts/mui/dual-list-select.md b/packages/react-renderer-demo/src/doc-components/examples-texts/mui/dual-list-select.md index 196804875..26af7f57b 100644 --- a/packages/react-renderer-demo/src/doc-components/examples-texts/mui/dual-list-select.md +++ b/packages/react-renderer-demo/src/doc-components/examples-texts/mui/dual-list-select.md @@ -23,6 +23,7 @@ Dual list select is wrapped in a form group, so it accepts all [form group props |filterOptionsText|String|'Remove your filter to see all options'|Placeholder for options when there is no filtered option| |checkboxVariant|bool|false|Change list item to checkboxes| |isFilterable|bool|true|Shows toolbar for both lists| +|isFilterCaseInSensitive|bool|true|Toolbar filter is case insensitive| ### Options