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

Pasting in combo box is not filtering the options

3 Answers 323 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Shubha Singh
Top achievements
Rank 1
Shubha Singh asked on 15 Oct 2015, 07:02 AM
when we are typing in the combo Box, it is filtering correctly, but when we are pasting the text using "control" + V or by mouse right click and paste, then the options are not filtered.

3 Answers, 1 is accepted

Sort by
0
Plamen Lazarov
Telerik team
answered on 19 Oct 2015, 05:53 AM

Hello Shubha Singh,

The ComboBox filtering is turned off by default. In order filter the values when pasting text via "Ctrl + V", I suggest setting an appropriate filter:

http://docs.telerik.com/kendo-ui/api/javascript/ui/combobox#configuration-filter

By design, filtering is performed when the keydown event is fired. When the value is pasted with the mouse, the event is not triggered, that's why the filtering is not working. This scenario is not supported, and I am afraid that there is no feasible workaround that I can offer. 

On a side note, in order to be able to work with "Kendo UI Complete" and benefit from our support service, your account must be associated with an active license or a trial. Your applicable commercial license expired on October 16, 2015.

If your company has spare licenses, please ask the license holder to assign your account as a licensed developer, as explained in "How do I assign developers to the purchased licenses?".

Regards,
Plamen Lazarov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Bailey
Top achievements
Rank 1
answered on 29 Mar 2016, 03:54 PM

I was able to resolve this problem by adding an event handler to the paste event and having the paste event trigger a keydown event on the input box, here's the code:

 

var ac = input.kendoComboBox({..}).data("kendoComboBox");

      ac.input.on("paste", function() {
        ac.input.trigger("keydown");
      });

0
Nencho
Telerik team
answered on 31 Mar 2016, 06:53 AM
Hello Bailey,

Thank you for sharing your solution with the community.

Regards,
Nencho
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Chris
Top achievements
Rank 1
commented on 28 Jan 2022, 10:14 PM | edited

@Bailey, Can you please post an example of how you did it.

I have a combobox $("#CompanyId").data("kendoComboBox"). How do I add event handler to this one? Appreciate your response

Tags
ComboBox
Asked by
Shubha Singh
Top achievements
Rank 1
Answers by
Plamen Lazarov
Telerik team
Bailey
Top achievements
Rank 1
Nencho
Telerik team
Share this question
or