jquery-ui icon indicating copy to clipboard operation
jquery-ui copied to clipboard

Autocomplete object should be wrapped in a div

Open TheWitness opened this issue 1 year ago • 4 comments

So, I'm trying to use the widget factory to build out a version of autocomplete that emulates select2() with a search box below the selected item and above the items themselves and having some difficulty.

It may be my lack of experience with the factory. However from my perspective, this would be much easier if instead of autocomplete object being simply a ul, it would be a ul wrapped by a div.

Is this something that the jQueryUI Team would consider? I would love to hear your comments on this topic.

TheWitness avatar Nov 27 '24 13:11 TheWitness

As seen below, I've been able to do this with Eric Hynds jQueryMultiselect, but am struggling using Autocomplete.

image

image

TheWitness avatar Nov 27 '24 13:11 TheWitness

We have used a simple hack to update selectmenu() to show a search as shown below. It was strait forward.

image

image

But Autocomplete has no such wrapper.

TheWitness avatar Nov 27 '24 13:11 TheWitness

Thanks for the report.

All changes to the widget structure are risky. Given limited team resources, issues like that are not likely to be fixed by the UI team; see the project status at https://blog.jqueryui.com/2021/10/jquery-maintainers-update-and-transition-jquery-ui-as-part-of-overall-modernization-efforts/.

Feel free to try preparing such a patch; it'd be interesting to see how many tests would fail. But I'm not optimistic we'd include such a modification in the widget.

mgol avatar Nov 29 '24 15:11 mgol

Yea, I was poking around with it and was just coming up to speed when I said to myself "whoever wrote this could fix it in like 10 minutes, I'll take 4 hours". So, I held out burning more time on it. Knowing the state of things, I'll take another crack at it.

TheWitness avatar Nov 30 '24 02:11 TheWitness