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

The selection focus of Tree is not updated in Firefox

XMLWordPrintable

    • ZK 9.5.1 S1

      Steps to Reproduce

      https://zkfiddle.org/sample/jp09jm/1-ZK-4741
      1. Scroll the Tree and select any item below "root.200".
      2. Click Fewer model.
      3. You shouldn't see a blank Tree.

      Current Result

      See a blank Tree.

      Expected Result

      See treeitems.

      Debug Information

      https://github.com/zkoss/zk/blob/v8.0.1/zul/src/archive/web/js/zul/sel/Tree.js#L171
      https://github.com/zkoss/zk/blob/v8.0.1/zul/src/archive/web/js/zul/sel/SelectWidget.js#L1313

      // reset the anchor to the top;
      jq(this.$n('a')).offset({top: 0, left: 0});
      

      => original code https://github.com/zkoss/zk/blob/v5.0.13/zul/src/archive/web/js/zul/sel/Tree.js#L106

      https://api.jquery.com/offset/#offset-function
      The element's border-box position is specified relative to the document.
      To reset the anchor to the top (related to the tree body), just set top: 0.

      Before 8.0.1, the result is right but the code is still wrong (please see the attached screenshot)

      Workaround

            rudyhuang rudyhuang
            rudyhuang rudyhuang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 4 hours
                4h
                Remaining:
                Remaining Estimate - 4 hours
                4h
                Logged:
                Time Spent - Not Specified
                Not Specified