• When used in a scrolling div tag, the popup appears way below the name field

    By Hans-Peter Kuessner 1 decade ago

    Hi Martijn,



    thanks for the outstanding job you, Richard and Steve have done!



    I'm just in the process of "webifying" a very ancient (and complex) Lotus Notes application, and needed a name picker. I embedded an other name picker first, but after a lot of work I realized that required features were missing. Then I stumbled upon your recently updated name picker, and integrated it successfully. Took some work, as I'm developing a dojo toolkit driven app with a lot of dijit.layout.TabContainers, dijit.Dialogs and so on, which somewhat collided with the popups you are providing. Mostly I was able to address these issues by tweaking the CSS and with some dojo.query calls, to avoid changing the NP libraries code. I'm very happy with that, especially that you have replaced the YUI libraries - one complex javascript toolkit (dojo) is enough for me…



    However I have discovered one problem (or bug), and had to edit the libraries source code.

    If you have a name field within a scrolling div tag (e. g. a dijit.layout.ContentPane within a dijit.layout.BorderContainer), and the name field is visible after scrolling down a bit, the popup will appear way below the name field. Seems like the positioning is based on the document's x/y coordinates versus the screen's x/y coordinates.



    I was able to resolve that issue by just taking dojo's methods here (dojo.position). The changed code is as follows:



    [code]

    function _findPos(obj) {

    / replaced HPK for quick2web enable -

    does not work with dijit.layout.BorderContainers with scrolling


    var curleft = curtop = 0;

    if (obj.offsetParent) {

    do {

    curleft += obj.offsetLeft;

    curtop += obj.offsetTop;

    } while (obj = obj.offsetParent);

    return [curleft,curtop];

    }// if

    */

    var coords = dojo.position(obj);

    return [coords.x, coords.y];

    }// function

    [/code]



    (Not sure why the formatting is not working, but I hope, you get the idea)



    While you probably won't use dojo code within your code (which would add just another dependency on a toolkit), I'm sure you will be able to solve that in direct code (main problem will be the browser differences though - dojo takes care of that very nicely).



    Once again: thanks for a great job



    Hans-Peter

    • Having trouble to duplicate

      By Martijn De Jong 1 decade ago

      I'm looking into this one, but I'm having trouble to duplicate it. I created a scrolling DIV tag with a name picker field on it, but the popup showed right where it should be in both Firefox 3.6 and IE6 (the 2 browsers I have available here at the moment). It could be a problem that's specific to the Dojo containers (in which case I could write some code to test if the Dojo.position function is available and if so, use that) or to a specific browser version which you use. Can you please let me know which browser you use and post a piece of the HTML where you see the problem?

    • scrolling div tag

      By Barry Lewin 1 decade ago

      I'm experiencing the same issue, in both IE& + firefox.  The issue doesn't appear if the name field is in the top half of the screen, but if it's in the lower half, then the popup positions itself not just below the field, but at the bottom of the page...

      I'm not using dojo, or any javascript framework

       

      Thanks

      Barry Lewin