Last Updated: 04 Aug 2021 09:05 by ADMIN
Created on: 28 Jul 2021 23:28
Category: MultiSelect
Type: Feature Request
Selecting custom value instead of data on Enter

Currently, given a multiselect with some data and allowCustom = true, if the user types "sm" and hits Enter, the control finds the first item in data that starts with "sm" and automatically selects that.

Repro: https://stackblitz.com/edit/angular-buffxv?file=app/app.component.ts

  1. Type "sm" in the MultiSelect and hit Enter
  2. "Small" is automatically selected, valueNormalizer is not hit at all

Looking at the code for the MultiSelect, the auto selection seems to happen because of findIndex(text, startsFrom = 0); the offending line: text && itemText.startsWith(text);

Ideally, the MultiSelect should give me a hook to determine what item is selected. Maybe hit valueNormalizer on Enter

1 comment
Posted on: 04 Aug 2021 09:05

Hi Musashi,

Thank you for the provided feedback.

We will track the customer demand for this enhancement and consider implementing it in the future based on the interest.

In general, the MultiSelect component automatically focuses the first match from the list when allowCustom is set to true, and this is the default behavior of the widget.

In order to customize the focused item programmatically, the developer can utilize the focusItemAt built-in method and highlight the desired item in the list.

Here is an example where the method is used in input event handler and always focuses the first (custom) item:


Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.