MaxRenderedOptions is not working with 1000

I am setting MaxRenderedOptions on Completion configuration as 1000 or 2000, but it still stops at a certain lower limit. Is there a max value that can be set, is there a way to change this?
Thanks in advance.

Are you using a lower-case m? What does your autocompletion(...) call look like?

Yes I am, this is my autocompletion() call:
autocompletion({override: [myCompletions, completeAnyWord], maxRenderedOptions: 2000})

It works if I am setting smaller numbers: if I set maxRenderedOptions: 15, I see only 15 suggestions;
if I change it to 100, I see 100 of them; but it stops at some number which more precisly should be 300. If I try to set 500, I will still see only 300 suggestions

Odd. I don’t see any logic that clips that option or does anything non-obvious with it. Are you sure you have enough completion options to render the amount you’re expecting here?

Trying to render all options (pressed ctrl+space):

writing any letter > then ‘s’:

Since there’s no “…” widget at the bottom of the options list, that first screenshot suggests that all the options have been rendered. Maybe you’re misunderstanding what maxRenderedOptions does? Could you explain a bit more clearly what behavior you’re expecting here?

Inside a function myCompletions(context) I am returning { from: word.from, options: myOptions }, where myOptions is an array with 1000 elements.
I am expecting, if I’m setting maxRenderedOptions as 1000, to get all of the 1000 myOptions elements as suggestions in the widget, also in the first screenshot. Instead, even though in myOptions there are elements starting with ‘t’, I am not seeing them in the first screenshot, because it stops at the 300th element.
Am I going wrong somewhere?

Argh, indeed, there was some code clipping off the option list at 300, going way back to when completion filtering was first implemented, before maxRenderedOptions even existed. I guess it was a crude attempt to avoid overloading the DOM. Attached patch removes it.

1 Like

Thanks Marijn, obviously now it is working perfectly