openOnEnter feature missing


we just migrated from Wicket 6 to Wicket 8 and that also brought a new version of Select2 into the project. In the old version (3.x) there used to be a feature “OpenOnEnter” that seems to be gone now in 4.x. Unfortunately I cannot find a replacement. Is there another way to prevent that the dropdowns open if the cursor is placed in the input-field?

Regards and thanks in advance

By the way: this is about multi-select, not single-select

If the behavior you want is that the dropdown should not appear until the user starts typing in the input field (rather than just selecting it), there is no built-in configuration option to do that. However, I can think of a couple of ways to “fake it”. The easiest way is probably to attach a focus event handler to the Select2’s input field (which you can access with $('input.select2-search__field')) that simply closes the dropdown. As long as focus remains in the input field, when the user types the dropdown will appear with matching items.

Thank you for the reply. In 3.x there was an option setOpenOnEnter(). Unfortunately this option has been removed as far as I can see.
I will try your suggestion,
Thanks and regards