AutoCompleteExtender positioning menu incorrectly when scrolled

Posted by Colin on Stack Overflow See other posts from Stack Overflow or by Colin
Published on 2010-06-07T16:39:43Z Indexed on 2010/06/07 16:42 UTC
Read the original article Hit count: 294

We have an AutoCompleteExtender linked to a TextBox. Both controls are placed inside an UpdatePanel, and the UpdatePanel is displayed as a pop-up dialog using a Javascript library (Ext.BasicDialog).

The pop-up is a div on the page, not a separate window. The problem is that when the user scrolls inside the pop-up, the AutoCompleteExtender shows its menu in the wrong place. It looks like it is taking the visible distance from the top of the popup and positioning the menu from the top of the inner html of the popup (which is not visible)

We are using Version 1.0.20229.20821 of the AjaxControlToolkit, and we are targetting ASP.NET Framework vewrsion 2.0.

I have tried to fix the menu by attaching the following Javascript to the OnClientShown event, but it pretty much does the same thing:

function resetPosition(object, args) {

    var tb = object._element; // tb is the associated textbox.
    var offset = $('#' + tb.id).offset();

    var ex = object._completionListElement;
    if (ex) {
        $('#' + ex.id).offset(offset);
    }  
} 

© Stack Overflow or respective owner

Related posts about ajaxcontroltoolkit

Related posts about autocompleteextender