This is a migrated thread and some comments may be shown as answers.

Select item on lost focus (blur)

2 Answers 700 Views
MultiSelect
This is a migrated thread and some comments may be shown as answers.
Yuriy Rogach
Top achievements
Rank 1
Iron
Yuriy Rogach asked on 21 Apr 2020, 01:15 PM
I have a kendo-multiselect with [allowCustom]="true" and when user enters custom text or filter items by typing text and then change focus from multiselect by pressing tab key or clicking outside of control - the multiselect dropdown is closed and the highlighted item is not being selected. Is there any way to select the highlighted item on blur event programmatically?

2 Answers, 1 is accepted

Sort by
0
Accepted
Svet
Telerik team
answered on 23 Apr 2020, 09:00 AM

Hi Yuriy,

Indeed, at the moment the required behavior isn't supported as a built-in feature.

What could be done as a workaround is to use some custom implementation based on the private properties of the MultiSelect as demonstrated in the following example:

https://stackblitz.com/edit/angular-nfndwa-8kvvnd?file=app/app.component.ts

However, that approach isn't based on the public API of the MutliSelect and isn't supported as a built-in feature. That means that it may no longer function as expected in a future version of the DropDowns package. Thus, using it should be based on the developer own discretion.

I also logged a new public feature request asking for a field that exposes the currently focused item. Please check it at the following link:

https://feedback.telerik.com/kendo-angular-ui/1463106-provide-the-currently-focused-item

That option will allow to track the currently focused item and it will make it possible on (blur) to select the currently focused item using built-in features. Please cast your vote for the feature request. That will help us to track the customer demand for such feature and we will eventually add it to our future development plans. Thank you.

Please let me know in case I can provide any additional information on this case.

Regards,
Svetlin
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
Yuriy Rogach
Top achievements
Rank 1
Iron
answered on 24 Apr 2020, 09:03 AM

Hi Svetlin,

 

Great! It's what I was looking for! Thanks!

If someone needs it with [allowCustom]="true" and [filterable]="true" here is an example

https://stackblitz.com/edit/angular-nfndwa-7ehhyh

 

 

Tags
MultiSelect
Asked by
Yuriy Rogach
Top achievements
Rank 1
Iron
Answers by
Svet
Telerik team
Yuriy Rogach
Top achievements
Rank 1
Iron
Share this question
or