diff --git a/api-generator/components/picklist.js b/api-generator/components/picklist.js index 163aaf41f..4dc358c33 100644 --- a/api-generator/components/picklist.js +++ b/api-generator/components/picklist.js @@ -11,12 +11,6 @@ const PickListProps = [ default: "null", description: "Selected items in the list as a multidimensional array." }, - { - name: "selectionMode", - type: "string", - default: "null", - description: 'Defines selection mode, options are "single" and "multiple".' - }, { name: "metaKeySelection", type: "boolean", diff --git a/src/components/picklist/PickList.d.ts b/src/components/picklist/PickList.d.ts index ffa57ab92..e0456e47a 100755 --- a/src/components/picklist/PickList.d.ts +++ b/src/components/picklist/PickList.d.ts @@ -3,7 +3,6 @@ import { VNode } from 'vue'; interface PickListProps { modelValue?: any[][]; selection?: any[][]; - selectionMode?: string; dataKey?: string; metaKeySelection?: boolean; listStyle?: any; diff --git a/src/components/picklist/PickList.vue b/src/components/picklist/PickList.vue index e1ed6387a..15a141e60 100755 --- a/src/components/picklist/PickList.vue +++ b/src/components/picklist/PickList.vue @@ -72,10 +72,6 @@ export default { type: Array, default: () => [[],[]] }, - selectionMode: { - type: String, - default: null - }, dataKey: { type: String, default: null @@ -391,19 +387,18 @@ export default { _selection = selectionList.filter((val, index) => index !== selectedIndex); } else { - if (metaKey) { - _selection = this.isMultipleSelectionMode() ? selectionList ? [...selectionList] : [] : []; - } - else { - _selection = []; - } - + _selection = (metaKey) ? selectionList ? [...selectionList] : [] : []; _selection.push(item); } } else { - _selection = this.isMultipleSelectionMode() ? selectionList ? [...selectionList] : [] : []; - _selection.push(item); + if (selected) { + _selection = selectionList.filter((val, index) => index !== selectedIndex); + } + else { + _selection = selectionList ? [...selectionList] : []; + _selection.push(item); + } } let newSelection = [...this.d_selection]; @@ -554,12 +549,6 @@ export default { document.head.removeChild(this.styleElement); this.styleElement = null; } - }, - isSingleSelectionMode() { - return this.selectionMode === 'single'; - }, - isMultipleSelectionMode() { - return this.selectionMode === 'multiple'; } }, computed: { diff --git a/src/views/picklist/PickListDoc.vue b/src/views/picklist/PickListDoc.vue index 54ddb5651..4b91a338f 100755 --- a/src/views/picklist/PickListDoc.vue +++ b/src/views/picklist/PickListDoc.vue @@ -104,12 +104,6 @@ import PickList from 'primevue/picklist'; null Selected items in the list as a multidimensional array. - - selectionMode - string - null - Defines selection mode, options are "single" and "multiple". - metaKeySelection boolean