At the moment, the OnChange even fires when:
The problem with the multiselect is that we have two extra actions:
I have a requirement to be able to select multiple values. I have filtering enabled, but I only want the user to be able to select valid values and not enter custom data. My approach would be to clear any invalid data when the control loses focus. I want the MultiSelect input to be cleared when it looses focus (similar to the ComboBox behavior).
=========================
ADMIN EDIT
=========================
In the meantime, such behavior could be achieved with a JavaScript function called through the JS Interop.
@inject IJSRuntime JsInterop
<TelerikMultiSelect Filterable="true" Data="@Countries"
@bind-Value="@Values"
Placeholder="Enter Balkan country, e.g., Bulgaria"
Width="350px" ClearButton="true"
AutoClose="false" OnBlur="@OnBlurHandler">
</TelerikMultiSelect>
@if (Values.Count > 0)
{
<ul>
@foreach (var item in Values)
{
<li>@item</li>
}
</ul>
}
@code {
List<string> Countries { get; set; } = new List<string>();
List<string> Values { get; set; } = new List<string>();
async Task OnBlurHandler()
{
await JsInterop.InvokeVoidAsync("clearMultiselectInput");
}
protected override void OnInitialized()
{
Countries.Add("Albania");
Countries.Add("Bosnia & Herzegovina");
Countries.Add("Bulgaria");
Countries.Add("Croatia");
Countries.Add("Kosovo");
Countries.Add("North Macedonia");
Countries.Add("Montenegro");
Countries.Add("Serbia");
Countries.Add("Slovenia");
base.OnInitialized();
}
}
You can include the following script tag in your index page or place the function in a separate JavaScript file in your project. This function will clear all instances of the Multiselect inputs, so you don't have to specify separate selectors for each of them. If you only want to work with one instance, you can use another approach.
<script>
function clearMultiselectInput() {
var inputs = document.querySelectorAll(".k-multiselect .k-input-values input");
inputs.forEach(e => e.value = "")
}
</script>
Using row virtualization on MultiSelect, and am attempting to put a loading indicator into the popup content if the request to the server is still ongoing.
Problem with this is that the popup contents don't update if the popup is open when loading finishes. I put together a reproduction on Telerik REPL showing the behavior I am experiencing.
https://blazorrepl.telerik.com/mvvQvVvN2458vinQ36
Note, Options finish loading (seen by the div update above the MultiSelect component), but if the popup is open, the contents do not update to reflect the loaded options.
My current workaround is to just make the MultiSelect disabled while it is doing its initial load.
To reproduce:
When @bind-Value is used, the tags are ordered in the way the user chose them, which is the expected behavior.
When you don't use two-way binding, but alter the Value in the ValueChanged event (to implement some logic), the tags get reordered according to the their occurrence in the data source.
I would expect that they remain the user order in all cases.
First visit of options in drop down, using keyboard:
When re-visiting the input when it has options selected as badges, using keyboard;
When user is inside list of selected options/items, navigating amongst the items with keyboard left/right keys, it states "item # of # of items of level 1".
what is "of level 1"? (is items selected in level 1 and level 2 is the text editable section?)
i am expecting the screen reader to state item "<value/label/title>" when i set focus to an item via keyboard left or right.
The issue did not occur in firefox. Sorry, i have not provided the firefox readout w/ the screen reader for comparison.
however, for the most likely user scenario the behaviour with the screen reader is correct.
if keyboard focus is on text edit, and u leave the component (w/ tab key), when revisiting the component (w/ shift+tab keys) all selected items are read out correctly
tested in Chrome and firefox using NVDA.
The following, took a bit of effort to identify where the behaviour was failing for a screen reader.
for all scenarios below the multi-select component currently has items (more than one) in it as selected.
GOOD
if keyboard focus is on text edit, and u leave the component (w/ tab key), when revisiting the component (w/ shift+tab keys) all selected items are read out correctly
BAD
if keyboard focus is on selected item, and u leave the component (w/ tab key), when revisiting the component (w/ shift+tab key) the focused (selected) item is not read out correctly.
(sorry example read out not provided)
GOOD
selected items are read out correctly when;
BAD
delete item;
the following behaviour also occurs after removing all items via a keyboard, the keyboard focus becomes lost;
Description
In Firefox, there are occasions in which multiple items remain focused (k-focus class is not removed from the blurred item)
Reproduction (if bug)
Second related case:
Expected (if bug)
Only one item should have the k-focus class at a time.
Browser (if bug)
Firefox
Broken Telerik UI for Blazor version (if bug)
3.5.0
Testing this Select All Checkbox sample in Safari produces a different result compared to other browsers.
Click on the CheckBox in the MultiSelect Header Template closes the popup in Safari. In other browsers (e.g. Chrome, Firefox) the popup remains open after checking the SelectAll CheckBox.
When AutoClose is set to false and you select more than one item, then only the first one will be highlighted in the popup. Items are selected and present in the input but are visually highlighted.
Reproduction
1. Run this REPL sampleI have set a small size to the MultiSelect. I noticed that the Summary Tag that contains the "1 more selected" text does not change - its size always remains the same regardless of the component size.
Reproduction: https://blazorrepl.telerik.com/cxFvPxvh58SMoekS04.
The Roundness setting of the MultiSelect also does not affect the summary tag.
Hi,
When displaying a MultiSelect control on a TelerikWindow (modal), the dropdown of items is displayed behind the dialog:
How can I change the Z-Index of the dropdown?