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

combobox shows its popup out of the visible range

    XMLWordPrintable

    Details

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

      Description

      Steps to Reproduce

      1. load the attached zul with chrome mobile device toolbar to simulate "iPad Pro"
      2. scroll down to the button
      3. click the combobox button to open its popup

      Current Result

      the popup appears at the position out of the visible range, you need to scroll down the whole page to see the popup.

      Expected Result

      the popup shows up at the bottom of the visible range

      Debug Info

      • datebox also has the same issue.

      Root Cause

      • <div vflex="1" style="border:solid 5px;overflow:auto"> cause the issue.
      • incorrect calculation for "top" at pps.top = jq.px((zk.ios ? window.innerHeight : innerHeight) + scrollOffset[1]); within _syncPosition()
        zk(cave).scrollOffset() adds all scroll offset by iterating every parent elements, which is incorrect for such case. Since page bottom position is not affected by a scrollbar inside an element e.g. <div>

      Workaround

      • eliminate the scrollbar of the combobox's parent
      • calculate it based on scroll position on a page, in _syncPosition()
        pps.top = jq.px((zk.ios ? window.innerHeight : innerHeight) + window.scrollY);

        Attachments

        1. 3682.zul
          2 kB
        2. popup.png
          popup.png
          10 kB

          Issue Links

            Activity

              People

              Assignee:
              wenninghsu wenninghsu
              Reporter:
              hawk hawk
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 30 minutes
                  30m