Skip to content

Commit

Permalink
fix(select list): update select list default value (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
lavanya-bmw authored Jan 30, 2024
1 parent c8ed680 commit f017634
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 2.1.22

- Select list default value functionality fix

## 2.1.21

- Add option to give an image element to Cards
Expand Down
2 changes: 1 addition & 1 deletion DEPENDENCIES
Original file line number Diff line number Diff line change
Expand Up @@ -1266,7 +1266,7 @@ npm/npmjs/@rollup/pluginutils/5.0.2, MIT, approved, clearlydefined
npm/npmjs/@sinclair/typebox/0.24.51, MIT, approved, #3330
npm/npmjs/@sinclair/typebox/0.27.8, MIT, approved, clearlydefined
npm/npmjs/@sinonjs/commons/1.8.6, BSD-3-Clause, approved, #4340
npm/npmjs/@sinonjs/commons/3.0.0, BSD-3-Clause, approved, clearlydefined
npm/npmjs/@sinonjs/commons/3.0.0, BSD-3-Clause, approved, #12905
npm/npmjs/@sinonjs/fake-timers/10.3.0, BSD-3-Clause, approved, #9214
npm/npmjs/@sinonjs/fake-timers/9.1.2, BSD-3-Clause, approved, #1957
npm/npmjs/@storybook/addon-actions/7.0.26, MIT, approved, #8972
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@catena-x/portal-shared-components",
"version": "2.1.21",
"version": "2.1.22",
"description": "Catena-X Portal Shared Components",
"author": "Catena-X Contributors",
"license": "Apache-2.0",
Expand Down
1 change: 1 addition & 0 deletions src/components/basic/SelectList/SelectList.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ SelectList.args = {
clearText: 'clear',
noOptionsText: 'No Options',
popperHeight: 0, // 0 = auto size
defaultValue: countries[0],
onChangeItem: (item: any) => console.log('selected:', item),
keyTitle: 'title',
}
2 changes: 1 addition & 1 deletion src/components/basic/SelectList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const SelectList = ({
const selectHeight = popperHeight ? `${popperHeight}px` : 'auto'
// Add an ESLint exception until there is a solution
// eslint-disable-next-line
const [selected, setSelected] = useState<any>({})
const [selected, setSelected] = useState<any>(defaultValue || {})
return (
<Autocomplete
id="singleSelectList"
Expand Down
3 changes: 1 addition & 2 deletions src/components/content/Cards/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,7 @@ export const Card = ({

useEffect(() => {
sortOption !== '' &&
submenuClick !== undefined &&
submenuClick(sortOption, id)
submenuClick?.(sortOption, id)
}, [sortOption, submenuClick, id])

useEffect(() => {
Expand Down

0 comments on commit f017634

Please sign in to comment.