-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Normal
-
Affects Version/s: 9.6.0
-
Component/s: Components
-
Security Level: Jimmy
-
None
Steps to Reproduce
run the attached example zk-5000.zul
case A) click a plus icon without scrolling down (on a row with index below 50)
case B) click a plus icon after scrolling down ... (on a row with index above 50)
Current Result
case A)
- the new row is added
- after a delay the row indices in the first column update
profiling result shows a dedicated block updating the link labels (rerendering the whole widget's DOM elements)
case B)
- the new row is added empty (white row)
- after a delay the row indices in the first column update
- after another delay the empty row is filled with the new row contents
profiling result now show 2 addtional blocks updating the link labels (rerendering the whole widget's DOM elements) and rendering the row contents
Expected Result
avoid delayed updates, avoid rebuilding whole widget's DOM structure in case only single properties such as label text changes
Debug Information
https://github.com/zkoss/zk/blob/v9.6.0/zul/src/archive/web/js/zul/LabelImageWidget.js#L31-L34
LabelImageWidget rerenders the whole DOM content even when only the label text changes.
Workaround
override the setLabel in zul.wgt.A:
below a naive approach (which doesn't cover all possible edge cases) to find/set the textNode.nodeValue directly
setLabel : function(label) { if(this._label === label) { return; } this._label = label; if(this.desktop) { var textNode = Array.prototype.find.call(this.$n().childNodes, node => node.nodeType === Node.TEXT_NODE); textNode.nodeValue = label; } }
- relates to
-
ZK-5001 combobox causing long UI freeze during unrelated widget updates
-
- Open
-