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

Set and increase the choice.js option searchResultLimit #209

Open
low-res opened this issue Feb 6, 2024 · 4 comments
Open

Set and increase the choice.js option searchResultLimit #209

low-res opened this issue Feb 6, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@low-res
Copy link

low-res commented Feb 6, 2024

Not a real bug, but still quite annoying: If you have to choose from a large number of user groups for the recipients, you have the problem that only four results are always given for selection when using the search. Even if many more options would actually match the search term.

This is because Choice.js only displays 4 options as search results by default. You could increase this value with the searchResultLimit option (https://github.com/Choices-js/Choices?tab=readme-ov-file#searchresultlimit-4).

It would be nice if this value was set and contained a sensible value like 10 or more?!

The change would be very simple. In luxletter/Resources/Public/JavaScript/Luxletter/Choices.min.js the optin just need to be set:

window.luxLetterReceiverChoice = new Choices(e, {allowHTML: !0, searchResultLimit:25})

@einpraegsam
Copy link
Collaborator

Thanks for your ticket. I just tested it again. I see 7 results. As far as I remember, we deliberately didn't want to display too many entries so that the options could still be seen on small screens.
screen

Or do I understand your request wrong?

@einpraegsam einpraegsam added the enhancement New feature or request label Feb 7, 2024
@low-res
Copy link
Author

low-res commented Feb 7, 2024

Hi @einpraegsam . Yeah as long as you do not search for something the list is complete and shows all options (and the list is scrollable!)

Bildschirmfoto 2024-02-07 um 15 28 50

But as soon as I start typing, the list always only shows 4 options (even if there are more options that need to be shown) and the list is not scrollable.

Bildschirmfoto 2024-02-07 um 15 29 15

@einpraegsam
Copy link
Collaborator

Ok, that seems to be correct. We could increase the size also to 7 if this would help you?
BTW: Your LUXletter version seems to be older and you would have to update to the latest version of course

@low-res
Copy link
Author

low-res commented Feb 7, 2024

To prevent problems like that, I think you should set the value pretty high. e.g. 100.

I just tried it out. The height of the visible optionslist is always 7 items. If the searchresults are more, the list gets scrollable.
So, the option searchResultLimit really means the max number of possible options and not the visible height of the optionslist. So a high value for searchResultLimit should always be fine-

I also found this issue Choices-js/Choices#1118 with a similr problem. But a value of -1 did not work in my tests.

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

No branches or pull requests

2 participants