admin管理员组

文章数量:1125794

The JQuery UI Demo page for autocomplete has a nice looking search box and drop down. When I implement it in my plugin, I end up with a bulleted list. How do I get my drop down of suggestions to look like theirs?As results shown in console but just bullet points here.

Yes,this is my code i applied some css by inspecting classes but the issue not resolved.

jQuery(document).ready(function($) {
    // ... Your existing code ...
    console.log('Autocomplete initialized'); 

    // Autocomplete functionality
    $('#search-input').autocomplete({
        source: function(request, response) {
            $.ajax({
                type: 'POST',
                datatype: 'json',
                url: custom_woocommerce_search_params.ajax_url,
                data: {
                    action: 'custom_woocommerce_auto_suggest',
                    search_query: request.term,
                },
                success: function (data) {
                     response(data);
                     console.log(data);
                         // Clear previous suggestions
   
   
                },
                error: function(error) {
                    console.log('Error:', error);
                }
            });
        },
        minLength: 2, // Minimum characters before triggering autocomplete
        select: function(event, ui) {
            // Handle selection if needed
        }
    });
});

本文标签: phpJQuery UI Autocomplete showing as bullets