mokkabonna / inquirer-autocomplete-prompt

Autocomplete prompt for inquirer
ISC License
354 stars 82 forks source link

`pageSize` option is not always followed when specified #23

Closed sindresorhus closed 7 years ago

sindresorhus commented 7 years ago

Here, I have set pageSize to 10, but it's showing more than 10 results. Interestingly, this doesn't happen on the first search character, in this case s.

If I don't specify pageSize, everything works perfectly.

screen shot 2017-02-27 at 10 41 44
mokkabonna commented 7 years ago

That is weird. I can't reproduce it on my system. Node 6.9.6, ubuntu 14.04 (elementary os). You are running OSX right?

Does it happen with any pageSize?

Can you check if it also happens with other prompts? I use the same paginator code as any prompt https://github.com/SBoudrias/Inquirer.js/blob/master/lib/utils/paginator.js

mokkabonna commented 7 years ago

I was able to reproduce it finally, however not with as many extra as you had. I was able to reproduce it with 2 more than the pageSize. And that is due to this: https://github.com/SBoudrias/Inquirer.js/blob/master/lib/utils/paginator.js#L22

mokkabonna commented 7 years ago

Try it again with the lastest version, fixed in inquirer.

sindresorhus commented 7 years ago

Works great. Thanks for fixing :)