-
Bug
-
Resolution: Fixed
-
Normal
-
8.0.1
-
Firefox 84.0b7 (64-bit)
-
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
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
- relates to
-
ZK-2901 getBoundingClientRect() is slow in ie
- Closed