Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-5149

DropUpload anchor position shifted by browser scroll if any, gets out of view

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 9.6.1
    • Fix Version/s: 9.6.2
    • Component/s: None
    • Security Level: Jimmy
    • Labels:
      None

      Description

      Steps to Reproduce

      Run fiddle: https://zkfiddle.org/sample/1955k98/5-Another-new-ZK-fiddle

      Scroll down a little, drag image to page

       

      Current Result

      The dropupload anchor position is shifted by the browser scroll position

       

      Expected Result

      Drop upload anchor position matches the anchor

      Debug Information

      Dropupload _dragShow() function finds anchor position using

      ofs = $anchor.offset()

      Which includes the scroll position of the browser into the offset.

      However, the dropupload sets the the CSS position:static property on the component, so it doesn't need to also be offset by browser scroll position

      Workaround

      Do not scroll browser, instead have a window containing the whole UI with the data-scrollable attribute:

       

      <zk xmlns:ca="client/attribute">
      <window title="bug drop upload" border="normal" vflex="1" contentStyle="overflow:auto;" ca:data-scrollable="true">
      
      UI CONTENT HERE
      
      </window>
      </zk>

      alternatively, use JS workaround in attached fiddle.

      (JS workaround is overriding a lot of functions, so only use if necessary)

        Attachments

          Activity

            People

            Assignee:
            DevChu DevChu
            Reporter:
            MDuchemin MDuchemin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: