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

onSize is calculated twice when borderlayout's region with "flex=true"

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 6.5.0
    • 6.0.1
    • Components
    • None

      For example,

      <zk>
      	<script>
      	zk.load('zul.mesh', function () {
      	var _meshWidget = {}
      	zk.override(zul.mesh.MeshWidget.prototype, _meshWidget, {
      		_calcSize: function () {
      			zk.log(this.uuid);
      			_meshWidget._calcSize.apply(this, arguments); //call the original method
      		}
      	});
      	});
      	</script>
      	<borderlayout>
      		<center flex="true">
      			<listbox>
      				<listitem label="1" />
      				<listitem label="2" />
      				<listitem label="3" />
      				<listitem label="4" />
      			</listbox>
      		</center>
      	</borderlayout>
      </zk>
      

      The issue is that, the flex of LayoutRegion with true will specify the child component to be vflex=true and hflex=true, and then the SelectWidget will trigger this.onSize() when invoking setVflex() and setHflex() functions in the SelectWidget.js

            vincentjian vincentjian
            jumperchen jumperchen
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: