Skip to content

Merge dimodi-patch-1-combo-kb-3059 into production #3060

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 20, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions knowledge-base/combobox-auto-select-on-blur.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ To automatically select the first matching item in the ComboBox when the input l
<ComboBoxPopupSettings Class="select-on-tab" />
</ComboBoxSettings>
</TelerikComboBox>
<br/>
<br/>
<TelerikTextBox Placeholder="Next form item" Width="200px"/>
<br />
<br />
<TelerikTextBox Placeholder="Next form item" Width="200px" />

@* Move JavaScript to a separate JS file *@
<script suppress-error="BL9992">
function attachComboKeyDown(selector) {
function attachComboKeyDown(selector) {
var comboInput = document.querySelector(selector);
if (comboInput) {
comboInput.addEventListener("keydown", onComboInputKeyDown);
Expand Down Expand Up @@ -109,7 +109,7 @@ To automatically select the first matching item in the ComboBox when the input l
[JSInvokable("OnComboBoxTab")]
public void OnComboBoxTab(string newStringValue)
{
if (ComboBoxFirstItem is not null && ComboBoxFirstItem.Text.Contains(newStringValue))
if (ComboBoxFirstItem is not null && ComboBoxFirstItem.Text.ToLowerInvariant().Contains(newStringValue.ToLowerInvariant()))
{
ComboBoxValue = ComboBoxFirstItem.Id;
ComboBoxFirstItem = default;
Expand All @@ -131,7 +131,7 @@ To automatically select the first matching item in the ComboBox when the input l
args.Data = result.Data;
args.Total = result.Total;

if (args.Request.Filters.Count > 0)
if (args.Request.Filters.Count > 0 && result.Data.Cast<ListItem>().Count() > 0)
{
ComboBoxFirstItem = args.Data.Cast<ListItem>().First();
}
Expand Down Expand Up @@ -160,10 +160,10 @@ To automatically select the first matching item in the ComboBox when the input l
for (int i = 1; i <= 24; i++)
{
ComboBoxData.Add(new ListItem()
{
Id = i,
Text = $"Item {i}"
});
{
Id = i,
Text = $"Item {i}"
});
}
}

Expand All @@ -182,4 +182,4 @@ To automatically select the first matching item in the ComboBox when the input l
````
## See Also

- [ComboBox Events](slug:components/combobox/events)
- [ComboBox Events](slug:components/combobox/events)