C# trigger keyup event on RadCombobox not working

1 Answer 92 Views
Coded Tests
Mohamed
Top achievements
Rank 1
Mohamed asked on 09 Feb 2023, 09:00 PM

private void SearchText(string itemText)
{
m_RadComboBox.Text = itemText;
m_OwnerBrowser.Actions.InvokeScript($"(function() {{ $telerik.$(\"#{m_RadComboBox.ID}\").trigger(\"keyup\") }})()");
WaitForDropDownWithText(itemText);
m_RadComboBox.Refresh();
}

We use this code to trigger keyup event after setting the "Text" field of a RadComboBox and it does not seem to work with Google Chrome.

We are using version 2022.3.1201.2

When we type in the RadComboBox the list is filtered as expected, the searched item is found and we get the exception below:


1 Answer, 1 is accepted

Sort by
0
Shtilianov
Telerik team
answered on 13 Feb 2023, 12:55 PM

Hi Mohamed,

I am sorry you experience any difficulties. 

I tried to replicate the misbehavior but wasn't able to reproduce the issue and the keyup events are fired as expected. From the behavior you are describe, it looks like the keyup events are not successfully handled by the comboBox itself. 

So, can you try a few things to clear up what's going on?

1. Try to execute the js trigger keyup event directly from the browser console and see what the behavior will be. If the keyup event is ignored, then you may try sending the event to the parent element of the RadComboBox instead.

2. You may also try to use the InvokeEvent method like this InvokeEvent(ArtOfTest.WebAii.Core.ScriptEventType.OnKeyUp); instead of InvokeScript. Assuming m_RadComboBox is of class HtmlControl, the InvokeEvent should be able to send the KeyUp event. 

Let me know what is the outcome of the above suggestions. Thank you for your cooperation in advance.

Regards, Miroslav Shtilianov Progress Telerik

Virtual Classroom is the free self-paced technical training portal that gets you up to speed with Telerik and Kendo UI products including Telerik Test Studio! Check it out at https://learn.telerik.com/.
Tags
Coded Tests
Asked by
Mohamed
Top achievements
Rank 1
Answers by
Shtilianov
Telerik team
Share this question
or