File tree 2 files changed +4
-4
lines changed
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @beeinventor/dasiot-react-component-lib" ,
3
- "version" : " 1.2.2 " ,
3
+ "version" : " 1.2.3 " ,
4
4
"module" : " lib/index.js" ,
5
5
"types" : " lib/index.d.ts" ,
6
6
"files" : [
Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ const DropdownV2: React.VFC<DropDownProps> = (props) => {
78
78
const [ isOpen , setIsOpen ] = useState ( false ) ;
79
79
80
80
useEffect ( ( ) => {
81
- if ( selectedId ) {
81
+ if ( selectedId && selectedId !== selectedItem ?. id ) {
82
82
for ( let i = 0 ; i < list . length ; i ++ ) {
83
83
if ( selectedId === list [ i ] . id ) {
84
84
setSelectedItem ( list [ i ] ) ;
@@ -136,7 +136,7 @@ const DropdownV2: React.VFC<DropDownProps> = (props) => {
136
136
className = { classNames (
137
137
'Dropdown-root' ,
138
138
{
139
- 'Dropdown-empty' : ! selectedItem ,
139
+ 'Dropdown-empty' : ! selectedId ,
140
140
} ,
141
141
{
142
142
'Dropdown--disabled' : disabled ,
@@ -149,7 +149,7 @@ const DropdownV2: React.VFC<DropDownProps> = (props) => {
149
149
onClick = { handleOnClickSelect }
150
150
{ ...otherProps }
151
151
>
152
- { selectedItem ?. name ?? placeholder }
152
+ { selectedId ?? placeholder }
153
153
< Icon className = "Dropdown-icon" >
154
154
{ isOpen ? < KeyboardArrowUp /> : < KeyboardArrowDown /> }
155
155
</ Icon >
You can’t perform that action at this time.
0 commit comments