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

tree item selection changes scroll position

XMLWordPrintable

    • ZK 8.5.2 S1
    • None

      Steps to Reproduce

      run the attached example bugtreescrollbar_simple.zul

      1) open "item-0"
      2) select an item below e.g. "item-0-0-1"

      Current Result

      the scroll position changes unnecessarily
      the scroll position even moves the selected item out of view

      Expected Result

      preserve the scroll position

      Debug Info

      this used to work in ZK 8.5.0 until the FL version 8.5.1.FL.20180131
      from 8.5.1.FL.20180201 on the scroll position changes unexpectedly/incorrectly

      only happens when the selection is updated from the server side

      Root Cause

      possible side effect of ZK-3835 ??
      https://github.com/zkoss/zkcml/commit/4b8375285fabac5de1a8b8030cedf45f1ea4e641

      Workaround

      in many cases it it not necessary to update the selected item when the user selects an item via mouse click, avoid setting the selection directly and avoid binding selectedItem="@bind(vm.selectedItem)" use TreeModel.getSelection() instead

            rudyhuang rudyhuang
            cor3000 cor3000
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 4 hours
                4h
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 hours
                4h