In the MultiSelect Component you have Item, Footer, and Header Template sub components. I see no way of providing a template for the selected items. This would be a very nice feature to have.
My specific use case it that I would like to add a tool tip to the selected tags.
Thanks
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>
I would like to have the ability to refresh the Multiselect Popup.
Currently, if the AutoClose="false" feature is applied and the items are programmatically selected, you cannot display them as selected while the Popup is opened. You need to close it first to accordingly update the selected items collection in it.
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.
Telerik Multi Select to have optional top level header item with check box & title "Select All" [Localizable].
If all items are selected, the display box of the Multi-Select should show "All Selected" instead of list of selected items.
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
To reproduce:
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;
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?
This appears to be documented behavior, but it also seems to me like this is something that the component should be handling.
When using row virtualization with a Grid, a DropDownList, a MultiSelect, etc, the OnRead is called for every scroll event, regardless of whether the component _actually_ needs to fetch new data or not.
For example: A DropDownList with a PageSize of 100, but with only 10 items visible in the dropdown at a time will ask for 100 records every time the user even scrolls 1 record down. This results in many requests to the backend server, with many of the results being the majority of the contents from the previous request.
I have worked around this by implementing a buffer that keeps results for me and returns them as the user scrolls, only requesting for more from the backend server when the buffer runs out, but this feels like something that the components themselves should be handling.
If this is expected behavior, all good. Just wanted to raise some awareness on it.
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.
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.
Hi team,
I just upgraded Blazor version to 2.25 and the primary button in FooterTemplate of MultiSelect started behaving differently. This was shown correctly prior to update. Also, normal button where Primary="true" is shown with correct styling.
I have written a little code snippet to demonstrate.
As it can be seen the the code for button is exactly same in both places but the output is different.
Please have a look into this.
Many thanks,
Hi,
I would like checkbox support including the check all checkbox on the multiselect component like: https://docs.telerik.com/devtools/aspnet-ajax/controls/combobox/functionality/checkbox-support
The url below shows how to create custom checkboxes in the multiselect component but adding a check all checkbox in the headertemplate does not update the multiselect popup
In drop down panel colour indicates which option has been selected (is it the dark colour or is the light colour). Suggestion: having an icon of tick would assist.
As an alternative option - Blazor MultiSelect - Templates | Telerik UI for Blazor this would be great if you could template selected and non-selected items, but at the moment there is just the one item template.
When re-visiting the input when it has options selected as badges, using keyboard;
First visit of options in drop down, using keyboard: