Skip to content

Commit

Permalink
Resolving format mismatch
Browse files Browse the repository at this point in the history
  • Loading branch information
AmirSaif committed Jul 7, 2024
1 parent a29791f commit 8cd350a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
10 changes: 4 additions & 6 deletions packages/common/src/dual-list-select/dual-list-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ interface InternalDualListSelectProps {
id?: string;
leftValues?: DualListOption[];
rightValues?: DualListOption[];
isFilterCaseInSensitive?: boolean;
FormFieldGridProps?: GridProps;
InternalGridProps?: GridProps;
ListGridProps?: GridProps;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 8cd350a

Please sign in to comment.