Skip to content

Commit 5a28459

Browse files
committed
fix(SelectPanel): do not depend on id for selection comparison
1 parent b03f78f commit 5a28459

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/react/src/SelectPanel/SelectPanel.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,11 +391,11 @@ function Panel({
391391
// For single-select modal, there is an intermediate state when the user has selected
392392
// an item but has not yet saved the selection. We need to check for this state.
393393
if (isSingleSelectModal) {
394-
return intermediateSelected?.id === item.id
394+
return intermediateSelected === item
395395
}
396396

397397
// For single-select anchored, we just need to check if the item is the selected item
398-
return selected?.id === item.id
398+
return selected === item
399399
},
400400
[selected, intermediateSelected, isSingleSelectModal],
401401
)

0 commit comments

Comments
 (0)