Skip to content

Commit

Permalink
fixed selection in multiselect dropdown (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bhavya-egov authored Jul 23, 2024
1 parent 7f7ab64 commit 3fdeb7a
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 10 deletions.
2 changes: 1 addition & 1 deletion react/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"build": "webpack --mode production"
},
"dependencies": {
"@egovernments/digit-ui-components": "0.0.2-beta.16",
"@egovernments/digit-ui-components": "0.0.2-beta.17",
"@egovernments/digit-ui-libraries": "1.8.2-beta.1",
"@egovernments/digit-ui-module-common": "1.7.10",
"@egovernments/digit-ui-module-core": "1.8.1-beta.6",
Expand Down
2 changes: 1 addition & 1 deletion react/modules/Project/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"dependencies": {
"@egovernments/digit-ui-react-components": "1.8.1-beta.4",
"@egovernments/digit-ui-components": "0.0.2-beta.16",
"@egovernments/digit-ui-components": "0.0.2-beta.17",
"lodash": "^4.17.21",
"react": "17.0.2",
"react-date-range": "^1.4.0",
Expand Down
2 changes: 1 addition & 1 deletion react/modules/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"prepublish": "yarn build"
},
"dependencies": {
"@egovernments/digit-ui-components": "0.0.2-beta.16",
"@egovernments/digit-ui-components": "0.0.2-beta.17",
"@egovernments/digit-ui-react-components": "1.8.1-beta.4",
"react": "17.0.2",
"react-dom": "17.0.2",
Expand Down
2 changes: 1 addition & 1 deletion react/modules/sample/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"dependencies": {
"@egovernments/digit-ui-react-components": "1.8.1-beta.4",
"@egovernments/digit-ui-components": "0.0.2-beta.16",
"@egovernments/digit-ui-components": "0.0.2-beta.17",
"react": "17.0.2",
"react-date-range": "^1.4.0",
"react-dom": "17.0.2",
Expand Down
2 changes: 1 addition & 1 deletion react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"@egovernments/digit-ui-module-sample": "0.0.1",
"@egovernments/digit-ui-react-components": "1.7.10",
"@egovernments/digit-ui-svg-components": "1.0.4",
"@egovernments/digit-ui-components": "0.0.2-beta.16",
"@egovernments/digit-ui-components": "0.0.2-beta.17",
"babel-loader": "8.1.0",
"clean-webpack-plugin": "4.0.0",
"css-loader": "5.2.6",
Expand Down
4 changes: 4 additions & 0 deletions react/ui-components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.0.2-beta.17] - 2024-07-23
### New Changes
- Updated multiselectdropdown

## [0.0.2-beta.16] - 2024-07-22
### New Changes
- Updated prop for Menu
Expand Down
2 changes: 1 addition & 1 deletion react/ui-components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@egovernments/digit-ui-components",
"version": "0.0.2-beta.16",
"version": "0.0.2-beta.17",
"license": "MIT",
"main": "dist/index.js",
"module": "dist/index.modern.js",
Expand Down
15 changes: 11 additions & 4 deletions react/ui-components/src/atoms/MultiSelectDropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,17 @@ const MultiSelectDropdown = ({
function reducer(state, action) {
switch (action.type) {
case "ADD_TO_SELECTED_EVENT_QUEUE":
return [
...state,
{ code: action.payload?.[1]?.code, propsData: action.payload },
];
// return [
// ...state,
// { code: action.payload?.[1]?.code, propsData: action.payload },
// ];
const updatedState = [...state, { code: action.payload?.[1]?.code, propsData: action.payload }];
onSelect(
updatedState.map((e) => e.propsData),
getCategorySelectAllState(),
props
);
return updatedState;
case "REMOVE_FROM_SELECTED_EVENT_QUEUE":
const newState = state.filter(
(e) => e?.code !== action.payload?.[1]?.code
Expand Down

0 comments on commit 3fdeb7a

Please sign in to comment.