Skip to content

Commit

Permalink
Allow PACKET key on MultiSelectionPrompt
Browse files Browse the repository at this point in the history
  • Loading branch information
nilaoda authored and patriksvensson committed Oct 13, 2022
1 parent f6a7c96 commit 8fa53f8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Spectre.Console/Prompts/MultiSelectionPrompt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ ListPromptInputResult IListPromptStrategy<T>.HandleInput(ConsoleKeyInfo key, Lis
return ListPromptInputResult.Submit;
}

if (key.Key == ConsoleKey.Spacebar)
if (key.Key == ConsoleKey.Spacebar || key.Key == ConsoleKey.Packet)
{
var current = state.Items[state.Index];
var select = !current.IsSelected;
Expand Down
2 changes: 1 addition & 1 deletion src/Spectre.Console/Prompts/SelectionPrompt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public async Task<T> ShowAsync(IAnsiConsole console, CancellationToken cancellat
/// <inheritdoc/>
ListPromptInputResult IListPromptStrategy<T>.HandleInput(ConsoleKeyInfo key, ListPromptState<T> state)
{
if (key.Key == ConsoleKey.Enter || key.Key == ConsoleKey.Spacebar)
if (key.Key == ConsoleKey.Enter || key.Key == ConsoleKey.Spacebar || key.Key == ConsoleKey.Packet)
{
// Selecting a non leaf in "leaf mode" is not allowed
if (state.Current.IsGroup && Mode == SelectionMode.Leaf)
Expand Down

0 comments on commit 8fa53f8

Please sign in to comment.