@@ -66,13 +66,13 @@ To automatically select the first matching item in the ComboBox when the input l
66
66
<ComboBoxPopupSettings Class="select-on-tab" />
67
67
</ComboBoxSettings>
68
68
</TelerikComboBox>
69
- <br/>
70
- <br/>
71
- <TelerikTextBox Placeholder="Next form item" Width="200px"/>
69
+ <br />
70
+ <br />
71
+ <TelerikTextBox Placeholder="Next form item" Width="200px" />
72
72
73
73
@* Move JavaScript to a separate JS file *@
74
74
<script suppress-error="BL9992">
75
- function attachComboKeyDown(selector) {
75
+ function attachComboKeyDown(selector) {
76
76
var comboInput = document.querySelector(selector);
77
77
if (comboInput) {
78
78
comboInput.addEventListener("keydown", onComboInputKeyDown);
@@ -109,7 +109,7 @@ To automatically select the first matching item in the ComboBox when the input l
109
109
[JSInvokable("OnComboBoxTab")]
110
110
public void OnComboBoxTab(string newStringValue)
111
111
{
112
- if (ComboBoxFirstItem is not null && ComboBoxFirstItem.Text.Contains(newStringValue))
112
+ if (ComboBoxFirstItem is not null && ComboBoxFirstItem.Text.ToLowerInvariant(). Contains(newStringValue.ToLowerInvariant() ))
113
113
{
114
114
ComboBoxValue = ComboBoxFirstItem.Id;
115
115
ComboBoxFirstItem = default;
@@ -131,7 +131,7 @@ To automatically select the first matching item in the ComboBox when the input l
131
131
args.Data = result.Data;
132
132
args.Total = result.Total;
133
133
134
- if (args.Request.Filters.Count > 0)
134
+ if (args.Request.Filters.Count > 0 && result.Data.Cast<ListItem>().Count() > 0 )
135
135
{
136
136
ComboBoxFirstItem = args.Data.Cast<ListItem>().First();
137
137
}
@@ -160,10 +160,10 @@ To automatically select the first matching item in the ComboBox when the input l
160
160
for (int i = 1; i <= 24; i++)
161
161
{
162
162
ComboBoxData.Add(new ListItem()
163
- {
164
- Id = i,
165
- Text = $"Item {i}"
166
- });
163
+ {
164
+ Id = i,
165
+ Text = $"Item {i}"
166
+ });
167
167
}
168
168
}
169
169
@@ -182,4 +182,4 @@ To automatically select the first matching item in the ComboBox when the input l
182
182
````
183
183
## See Also
184
184
185
- - [ ComboBox Events] ( slug:components/combobox/events )
185
+ - [ ComboBox Events] ( slug:components/combobox/events )
0 commit comments