How can I add autocomplete input field to Confluence macro?

Hi,

We maintain a self-made Confluence plugin which no longer works as expected after upgrading Confluence from version 6.13.4 to 7.4.5. The plugin fetches a long list of items from an external source and let’s the user pick an item via an autocompleted input field. I’ve tracked down the problem to a very minimal example of what essentially happens in our code. An input field is added to the DOM and a list of values for autocompletion is added to it:

$("#macro-insert-container .macro-input-fields").append("<input id='test-input' type='text'/>") 
$("#test-input").autocomplete({
    source: [ "Choice1", "Choice2" ]
});

This autocomplete() no longer works as before, the input field no longer shows any dropdown menu and no signs of autocompletion. All I find is a new ol element that got created:

<input id="test-input" type="text">
<ol class="autocompleter" style="position: absolute; width: 175px; margin: -1px 0px 0px; display: none;"></ol>

Interestingly enough, this introduces a new effect that I don’t understand. When typing some characters into the input field, a GET request gets issued to this URL (resulting in error 404):
https://my.domain/confluence/pages/[object%20Object]Choice?_=1613554085531

Any ideas what’s going on here and why our autocompletion stopped working?
What is the recommended way of implementing an autocompleted input field?

Regards,
Dominik

Hi @dokaspar,
As far as I understand you want set autocompleted field that gets data from external source in macro browser window. As a solution I propose you use Select2 for autocompleted field. See https://community.atlassian.com/t5/Confluence-questions/How-to-make-a-parameter-a-label-picker-in-the-Macro-Browser/qaq-p/377605?_ga=2.130054095.1955617452.1614180420-1115907145.1580900645#U1011378.. If you need full example how to implement it, please let me know.