Hi,
I'm using the RadAutoCompleteBox in one of our web forms and I'm having an issues with it on Microsoft Edge Mobile.
As it has problems with my OnClientLoad js function and only if I remove the OnClientLoad="OnClientLoad" binding from the control declaration the autocomplete will work.
In the desktop version of edge all is well same for chrome and chrome mobile,
the error:
"OnClientLoad is not defined"
"ReferenceError: OnClientLoad is not defined at Array.<anonymous> (https://my-domain.com/syllabisearch/he/pages/default.aspx:272:176322) at https://my-domain.com/syllabisearch/Scripts/WebForms/MsAjax/MicrosoftAjax.js:6:51370 at Sys._Application._raiseInit (https://my-domain.com/syllabisearch/Scripts/WebForms/MsAjax/MicrosoftAjax.js:6:72276) at Sys._Application.initialize (https://my-domain.com/syllabisearch/Scripts/WebForms/MsAjax/MicrosoftAjax.js:6:69772) at b (https://my-domain.com/syllabisearch/Scripts/WebForms/MsAjax/MicrosoftAjax.js:6:71512) at HTMLDocument.a (https://my-domain.com/syllabisearch/Scripts/WebForms/MsAjax/MicrosoftAjax.js:6:71786)"
and the breakpoint is on the following code (attached in 'code-snippet-1.zip').
Here is my OnClientLoad JavaScript Function
01.
function OnClientLoad(sender, args) {
02.
$(".racToken").attr('tabindex', 0);
03.
var autoCompleteBox = $find("<%= RadAutoCompleteSearchBox.ClientID %>");
04.
var entryGeneralTitle = '<%=Idc.Yedion.SyllabiSearch.Helpers.Util.getLocalizedValue("AccessibilityGeneralSearchAutoCompleteBoxClear", CurrentLanguage)%>';
05.
var selectedEntryTitle = entryGeneralTitle.replace('{0}', autoCompleteBox.get_entries()?.getEntry(0)?.get_text());
06.
$(".racRemoveTokenLink").attr('title', selectedEntryTitle);
07.
$(".racToken").attr('title', selectedEntryTitle);
08.
$(".racRemoveTokenLink").attr('aria-label', selectedEntryTitle);
09.
$(".racToken").attr('aria-label', selectedEntryTitle);
10.
$(".racToken").on('keypress', function (e) {
11.
var key = e.which;
12.
if (key == 13) {
13.
e.preventDefault();
14.
autoCompleteBox.get_entries().clear();
15.
$("#<%= BtnClearSearch.ClientID %>").click();
16.
}
17.
18.
});
19.
$(".racToken").on('keydown', function (e) {
20.
var key = e.which;
21.
if (key == 8 || key == 46) {
22.
e.preventDefault();
23.
autoCompleteBox.get_entries().clear();
24.
$("#<%= BtnClearSearch.ClientID %>").click();
25.
}
26.
});
27.
$telerik.$(sender.get_inputElement()).on('keypress', function (e) {
28.
if (sender.get_entries().get_count() > 0) {
29.
e.preventDefault();
30.
}
31.
});
32.
33.
}
And this is my control declaration
1.
<
telerik:RadAutoCompleteBox
ID
=
"RadAutoCompleteSearchBox"
AllowCustomEntry
=
"false"
EnableAriaSupport
=
"true"
InputType
=
"Token"
ItemType
=
"Idc.Yedion.Internet.ObjectsModels.GeneralSearchResult"
runat
=
"server"
MinFilterLength
=
"2"
TextSettings-SelectionMode
=
"Single"
TokensSettings-AllowTokenEditing
=
"false"
OnClientLoad
=
"OnClientLoad"
DropDownPosition
=
"Static"
RenderMode
=
"Lightweight"
EnableScreenBoundaryDetection
=
"true"
EnableDirectionDetection
=
"true"
ZIndex
=
"1"
OnEntryAdded
=
"RadAutoCompleteSearchBox_EntryAdded"
OnEntryRemoved
=
"RadAutoCompleteSearchBox_EntryRemoved"
EnableClientFiltering
=
"true"
Skin
=
"Bootstrap"
Width
=
"100%"
></
telerik:RadAutoCompleteBox
>
Please advice,
Thanks,
Hagai.