diff --git a/package.json b/package.json index f3aa1e1b..145e5de3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@cadolabs/sphere-ui", - "version": "4.1.1", + "version": "4.1.2", "main": "dist/index.js", "license": "MIT", "repository": "https://github.com/Cado-Labs/sphere-ui", diff --git a/src/components/MultiSelect/index.js b/src/components/MultiSelect/index.js index 4cc95ffe..910629c7 100644 --- a/src/components/MultiSelect/index.js +++ b/src/components/MultiSelect/index.js @@ -29,7 +29,6 @@ export const MultiSelect = React.forwardRef(({ id = null, disabled = false, showClear = false, - removeIcon = false, }, ref) => { const multiselectRef = useRef(ref) @@ -55,6 +54,10 @@ export const MultiSelect = React.forwardRef(({ return isFunction ? optionDisabled() : optionDisabled } + const removeIcon = () => { + return isOptionDisabled() ? false : "pi pi-times-circle" + } + const renderHeader = () => { return filter ? null : } @@ -109,7 +112,7 @@ export const MultiSelect = React.forwardRef(({ selectedItemsLabel={selectedItemsLabel} showClear={showClear} display={display} - removeIcon={removeIcon} + removeIcon={removeIcon()} /> ) }) diff --git a/storybook/i18n/locales/stories/multiselect/en.yml b/storybook/i18n/locales/stories/multiselect/en.yml index e3517a40..1e206b98 100644 --- a/storybook/i18n/locales/stories/multiselect/en.yml +++ b/storybook/i18n/locales/stories/multiselect/en.yml @@ -24,4 +24,3 @@ props: selectedItemsLabel: Function that gets an item in the value and returns the content for it. showClear: Displays an icon to clear the value. display: Used mode to display the selected item. Valid values are 'comma' and 'chip'. - removeIcon: Icon of the remove chip element. diff --git a/storybook/stories/form/MultiSelect/multiSelect.js b/storybook/stories/form/MultiSelect/multiSelect.js index d0ba74c2..f437d7fb 100644 --- a/storybook/stories/form/MultiSelect/multiSelect.js +++ b/storybook/stories/form/MultiSelect/multiSelect.js @@ -65,7 +65,6 @@ export const multiSelect = { { name: "selectedItemsLabel", type: "string", description: `${I18N_PREFIX}.props.selectedItemsLabel` }, { name: "showClear", type: "boolean", default: false, description: `${I18N_PREFIX}.props.showClear` }, { name: "display", type: "string", description: `${I18N_PREFIX}.props.display` }, - { name: "removeIcon", type: "any", default: false, description: `${I18N_PREFIX}.props.removeIcon` }, ], eventDescriptionProps: [ { name: "onChange", params: onChangeParams, description: `${I18N_PREFIX}.props.onChange` },