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

RadComboBox does not work correctly in legacy Edge

3 Answers 103 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 29 Jan 2020, 12:52 AM

Not sure if this is the right place for the thread, but I cannot find a "RadComboBox" section.

Browser:

Microsoft Edge 44.18362.449.0

Telerik Control:

RadCombobox

Teleri Version:  Version=2017.3.913.45,

Issue:

When a item is selected and a postback is occured, the SelectedValue returns an empty string.

Expected behavior:

The correct SelectedValue should be return.

Thing that have been tried so far:

1: upgrade the telerik to the latest version (2020.114) ---> issue persists

2: set autopostback to "true" problem solved

3: use other browsers (chrome, FireFox, new Version 79.0.309.68 ) issue disappears

Sample code: 

1: aspx

<telerik:radcombobox
        id="ddlSupplier"
        runat="server"
        skin="Material"
        rendermode="Lightweight"
        cssclass="materializeit"
        enableloadondemand="true"
        inputcssclass="browser-default"
        width="100%"
        filter="Contains"
        highlighttemplateditems="true"
        showmoreresultsbox="false"
        onitemsrequested="ddlSupplier_ItemsRequested" autopostback="false">
    </telerik:radcombobox>

2: code behind

protected void Page_Load(object sender, EventArgs e)
    {
    }
 
    protected void saveIssue_Click(object sender, EventArgs e)
    {
 
 
    }
 
    protected void ddlSupplier_ItemsRequested(object sender, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e)
    {
        RadComboBoxItem li = new RadComboBoxItem("Alan Jones (Brunel Systems Pty Ltd, test site)", "123");
 
        ddlSupplier.Items.Add(li);
 
         li = new RadComboBoxItem("Jackie Chiu (Optimum Construction, Optimum Construction (Sydney)) ", "23" );
 
        ddlSupplier.Items.Add(li);
 
         li = new RadComboBoxItem("Erik Baker (Optimum Construction, Optimum Construction (Sydney))", "2323");
 
        ddlSupplier.Items.Add(li);
    }
 
    protected void b_Click(object sender, EventArgs e)
    {
        var a = ddlSupplier.SelectedValue;  // most of the time returns "" for Edge
    }

3 Answers, 1 is accepted

Sort by
0
Peter Milchev
Telerik team
answered on 30 Jan 2020, 03:35 PM

Hello Mark,

Thank you for reporting this issue and sharing the reproduction steps and code. 

Indeed, there is an issue and we have been investigating it. The strange thing is that for some reason the selected item's text has a new line at the end, which makes it different from the text of the ComboBox, hence the value is cleared. 

The even stranger thing is that if you call the get_text() method of the items before selecting them, the issue is not replicated. Please verify this by using the following handler of the OnClientItemsRequested event:

<telerik:RadComboBox
    ID="ddlSupplier"
    runat="server"
    Skin="Material"
    OnClientItemsRequested="OnClientItemsRequested"
    RenderMode="Lightweight"
    CssClass="materializeit"
    EnableLoadOnDemand="true"
    InputCssClass="browser-default"
    Width="100%"
    Filter="Contains"
    HighlightTemplatedItems="true"
    ShowMoreResultsBox="false"
    OnItemsRequested="ddlSupplier_ItemsRequested" AutoPostBack="false">
</telerik:RadComboBox>
<script>
    function OnClientItemsRequested(sender, args) {
        ddlSupplier.get_items().forEach(function (it) {
            console.log(it.get_text());
        });
    }
</script>

 

As a token of gratitude for helping us identify the issue, we have updated your Telerik points.

Looking forward to your reply.

Regards,
Peter Milchev
Progress Telerik

Get quickly onboarded and successful with UI for ASP.NET AJAX with the Virtual Classroom technical trainings, available to all active customers. Learn More.
0
Mark
Top achievements
Rank 1
answered on 03 Feb 2020, 01:02 AM

Thanks Peter,

Your suggested work around / hack does work in our development environment, however does not feel appropriate to push out to production.

Do you have a sense of when this bug is likely to be fixed?

0
Peter Milchev
Telerik team
answered on 05 Feb 2020, 03:25 PM

Hello Mark,

I have created a bug report in our feedback portal which you can follow to get notified when there is any progress on it. Unfortunately, cannot provide any specific timeframe on it.

Regarding the workaround, it should be harmless to be in production as a temporary fix. It can be modified so that it is executed only in the legacy Edge browser:

function OnClientItemsRequested(sender, args) {
    // temporary workaround for https://feedback.telerik.com/aspnet-ajax/1452415-radcombobox-does-not-work-correctly-in-legacy-edge
    if (Telerik.Web.Browser.edge && !Telerik.Web.Browser.chrome) {
        sender.get_items().forEach(function (it) {
            // the get_text() needs to be called, although it does nothing special
            it.get_text();
            //console.log(it.get_text());
        });
    }
}

Regards,
Peter Milchev
Progress Telerik

Get quickly onboarded and successful with UI for ASP.NET AJAX with the Virtual Classroom technical trainings, available to all active customers. Learn More.
Tags
Ajax
Asked by
Mark
Top achievements
Rank 1
Answers by
Peter Milchev
Telerik team
Mark
Top achievements
Rank 1
Share this question
or