Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SelectionPrompt with odd page size can show smaller page size #1363

Closed
reduckted opened this issue Nov 11, 2023 · 0 comments · Fixed by #1365
Closed

SelectionPrompt with odd page size can show smaller page size #1363

reduckted opened this issue Nov 11, 2023 · 0 comments · Fixed by #1365
Assignees
Labels
bug Something isn't working

Comments

@reduckted
Copy link

reduckted commented Nov 11, 2023

Information

  • OS: Any
  • Version: 0.47.0
  • Terminal: Any

Describe the bug
When using SelectionPrompt with an odd page size, if you move the selection towards the end of the list, the number of choices shown in the page is reduced by one.

To Reproduce

using Spectre.Console;

namespace Playground;

class Program {
   static void Main() {
      var prompt = new SelectionPrompt<string>()
        .Title("Select one")
        .AddChoices(
            "One",
            "Two",
            "Three",
            "Four",
            "Five",
            "Six",
            "Seven",
            "Eight"
         ).PageSize(5);

      AnsiConsole.Prompt(prompt);
   }
}

Expected behavior
The list always shows the number of choices specified in the page size, regardless of which choice is selected.

Screenshots
selection-prompt

Additional context
An even page size always shows the correct number of choices.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done 🚀
Development

Successfully merging a pull request may close this issue.

2 participants