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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 9.6.2
    • 9.6.1
    • None
    • Security Level: Jimmy

      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)

            DevChu DevChu
            MDuchemin MDuchemin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: