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

when the length of list is over default pageSize ,arrow up and down key actions incorrect #1107

Closed
daring123 opened this issue Apr 27, 2022 · 7 comments

Comments

@daring123
Copy link

daring123 commented Apr 27, 2022

os: macos Catalina
version: 8.2.3

code :

import inquirer from 'inquirer';

const choices = Array.apply(0, new Array(26)).map((_: any, y: any) => String.fromCharCode(y + 65));
inquirer
  .prompt([
    {
      type: 'list',
      loop: false,
      name: 'letter',
      message: "What's your favorite letter?",
      choices,
    },
    {
      type: 'checkbox',
      name: 'name',
      message: 'Select the letter contained in your name:',
      choices,
    },
  ])
  .then((answers: any) => {
    console.log(JSON.stringify(answers, null, '  '));
  });

when I press the "down key" , it will page down ,not point the next one selection

image

image

@lukahartwig
Copy link

I can confirm the bug. Seems to be a regression in 8.2.3. Downgrading to 8.2.2 works for me.

@truesteps
Copy link

Can confirm, this is happening since 8.2.3. Downgrade to 8.2.2 fixes it for me

@SBoudrias
Copy link
Owner

Hey @starpit, I was wondering if there was any chance you could look into this? It seems to occur starting with the ansi-wrap change 😓

@starpit
Copy link
Contributor

starpit commented Apr 27, 2022

The bug seems to be that breakLines is expected, by the paginator, to return a doubly-nested array, where the inner array are the lines into which a line might be broken.

The main screen manager does not rely on this aspect.

I'll send a PR.

@starpit
Copy link
Contributor

starpit commented Apr 27, 2022

@SBoudrias PR in flight: #1108

@SBoudrias
Copy link
Owner

8.2.4 is out with the fix! Send thanks towards @starpit 😉

@truesteps
Copy link

Fixed the issue for me! Thanks for the quick fix <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants