From b4eb83de8637b56d7d742f5e64bda454ef8c2410 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Fri, 27 Feb 2026 14:10:06 +0000 Subject: fix: deselected items re-appear as selected when adding new item Sync the defaults vector to the user's actual selections after each prompt in multi_select_with_custom_value, so deselected items are not shown as checked on the next loop iteration. --- src/lib/cli_interactor.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/lib/cli_interactor.rs') diff --git a/src/lib/cli_interactor.rs b/src/lib/cli_interactor.rs index 97f99e8..cfb41f0 100644 --- a/src/lib/cli_interactor.rs +++ b/src/lib/cli_interactor.rs @@ -420,8 +420,12 @@ where .with_defaults(current_defaults), )?; - // Collect selected choices + // Collect selected choices and update defaults to reflect the user's actual + // selections selected_choices.clear(); // Clear previous selections to update + for (i, default) in defaults.iter_mut().enumerate() { + *default = selected_indices.contains(&i); + } for &index in &selected_indices { if index < choices.len() { // Exclude 'add another' option -- cgit v1.2.3