@@ -13,8 +13,8 @@ import type {PreparedPartitionDataWithHosts} from '../utils/types';
1313
1414interface PartitionsControlsProps {
1515 consumers : string [ ] | undefined ;
16- selectedConsumer : string ;
17- onSelectedConsumerChange : ( consumer : string ) => void ;
16+ selectedConsumer ? : string ;
17+ onSelectedConsumerChange : ( consumer ? : string ) => void ;
1818 selectDisabled : boolean ;
1919 partitions : PreparedPartitionDataWithHosts [ ] | undefined ;
2020 onSearchChange : ( filteredPartitions : PreparedPartitionDataWithHosts [ ] ) => void ;
@@ -111,7 +111,8 @@ export const PartitionsControls = ({
111111 } , [ initialColumnsIds , hiddenColumns ] ) ;
112112
113113 const handleConsumerSelectChange = ( value : string [ ] ) => {
114- onSelectedConsumerChange ( value [ 0 ] ) ;
114+ // Do not set empty string to state
115+ onSelectedConsumerChange ( value [ 0 ] || undefined ) ;
115116 } ;
116117
117118 const handlePartitionIdSearchChange = ( value : string ) => {
@@ -151,7 +152,7 @@ export const PartitionsControls = ({
151152 className = { b ( 'consumer-select' ) }
152153 label = { i18n ( 'controls.consumerSelector' ) }
153154 options = { consumersToSelect }
154- value = { [ selectedConsumer ] }
155+ value = { [ selectedConsumer || '' ] }
155156 onUpdate = { handleConsumerSelectChange }
156157 filterable = { consumers && consumers . length > 5 }
157158 disabled = { selectDisabled || ! consumers || ! consumers . length }
0 commit comments