File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -738,10 +738,25 @@ export class DeepnoteInputBlockCellStatusBarItemProvider
738738 void this . updateCellMetadata ( cell , { deepnote_variable_value : [ ] } ) ;
739739 }
740740 } ) ;
741+ } else {
742+ // If empty values are not allowed, ensure at least one item is always selected
743+ quickPick . onDidChangeSelection ( ( selectedItems ) => {
744+ if ( selectedItems . length === 0 ) {
745+ // Prevent deselecting the last item - restore previous selection
746+ quickPick . selectedItems = optionItems . filter ( ( item ) => item . picked ) ;
747+ }
748+ } ) ;
741749 }
742750
743751 quickPick . onDidAccept ( ( ) => {
744752 const selected = quickPick . selectedItems ;
753+
754+ // If empty values are not allowed, ensure at least one item is selected
755+ if ( ! allowEmpty && selected . length === 0 ) {
756+ void window . showWarningMessage ( l10n . t ( 'At least one option must be selected' ) ) ;
757+ return ;
758+ }
759+
745760 const newValue = selected . map ( ( item ) => item . label ) ;
746761 void this . updateCellMetadata ( cell , { deepnote_variable_value : newValue } ) ;
747762 quickPick . hide ( ) ;
You can’t perform that action at this time.
0 commit comments