How do I style the autocomplete list items if they keep disappearing

1 Answer 11 Views
AutoComplete
sitefinitysteve
Top achievements
Rank 2
Iron
Iron
Veteran
sitefinitysteve asked on 28 Jul 2025, 02:11 PM

Normally just select the item in the browser inspector, and style, but the second I tap ANYWHERE the autocomplete items disappear.  Is there some way to persist them just for styling?

 

1 Answer, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 31 Jul 2025, 11:13 AM

Hello Steve,

You are correct—the AutoComplete suggestion popup closes automatically when it loses focus, which makes inspecting and styling the list items challenging. To keep the popup open while you work on your styles, you can temporarily prevent it from closing by handling the widget's close event and calling e.preventDefault().

Here’s how you can do this:

$("#autocomplete").kendoAutoComplete({
    dataSource: ["Item1", "Item2", "Item3"],
    close: function(e) {
        // Prevent the popup from closing so you can inspect and style it
        e.preventDefault();
    }
});

With this setup, the popup will remain open even if you click outside of it, allowing you to inspect and apply custom styles using your browser’s developer tools. Once you finish styling, you can remove or comment out the close event handler to restore the normal closing behavior.

This approach is intended for development and inspection purposes only, not for production use.

Regards,
Nikolay
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
AutoComplete
Asked by
sitefinitysteve
Top achievements
Rank 2
Iron
Iron
Veteran
Answers by
Nikolay
Telerik team
Share this question
or