Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/red-ghosts-cry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cube-dev/ui-kit": patch
---

Fix ListBox icon detection and selection change handler dependencies. Custom icons on ListBox items are now properly detected, and the selection change handler correctly responds to `disableSelectionToggle` prop changes.
6 changes: 3 additions & 3 deletions src/components/fields/ListBox/ListBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ export const ListBox = forwardRef(function ListBox<T extends object>(
externalSelectionHandler,
isDisabled,
props.selectionMode,
showSelectAll,
disableSelectionToggle,
]);

// Prepare props for useListState with correct selection props
Expand Down Expand Up @@ -1108,7 +1108,7 @@ function Option({
if (
!isCheckable ||
state.selectionManager.selectionMode !== 'multiple' ||
item.icon
filteredItemProps.icon
) {
return (
filteredItemProps.icon ??
Expand Down Expand Up @@ -1149,7 +1149,7 @@ function Option({
isFocused,
isHovered,
validationState,
item.icon,
filteredItemProps.icon,
]);

// Custom click handler for the entire option
Expand Down
Loading