You found a bug! We've classified it as TOUCH-2582 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha Premium Member
    Join Date
    Jan 2012
    Posts
    81
    Vote Rating
    0
    Omer Paran is on a distinguished road

      0  

    Default setTop does not work properly after drag

    setTop does not work properly after drag


    Another Drag problem, I hope they are all related somehow...

    1) Create a panel at (x,y) position on the screen
    2) Read the top location of the panel
    3) call setTop with that location - of course the panel stays in place - good
    4) Move the panel to a new location
    5) read the new top location
    6) Call setTop with that location
    7) The panel is moved up (or down) in the amount of pixels that are the difference between the original location and the new location, and each call to another setTop, moves it again up (or down)

    Ex: If the panel was opened at 100 (top) and moved to 98 - then calling setTop(98) when it is at the 98 top position, will move it to 96 - then when calling setTop(96) it will be moved to 94 and so on

  2. #2
    Sencha - Sencha Touch Dev Team Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    21
    Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough

      0  

    Default


    Thank you for the report, I'll add it to the issues for Draggable.

    Sencha Inc

    Jamie Avins

    @jamieavins

  3. #3
    Sencha Premium Member
    Join Date
    Jan 2012
    Posts
    81
    Vote Rating
    0
    Omer Paran is on a distinguished road

      0  

    Default More Information

    More Information


    Just wanted to add why we even bother to do so:

    As you know, hiding and showing and panel restricts the drag area (I have filled another bug for that) , so our work around for this (until you fix the bug of course), was to move the panel of the screen say for example to -500 and then when "showing" it , return it to its original location.

    But we have noticed that if the panel was moved , when it is returned to the original location, it is returned with an offset.

    Also: using JQuery to get the DOM element , and using "panelDom.css('top',self.lastTop + 'px');" - has the same problem

    Again: It only happens if the panel is dragged first and it has nothing to do with setting the offset to -500 , it was only given as an example why we even do it

    thanks again

    Omer.

Thread Participants: 1