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

Listbox/Grid sizedBycontent and hflex="min" does not work anymore

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 8.5.2, 8.5.2.1
    • Fix Version/s: 8.6.1
    • Component/s: grid
    • Security Level: Jimmy
    • Labels:
    • gh.sprint.customfield.default.name:
      ZK 8.6.1 S1

      Description

      Steps to Reproduce

          <library-property>
              <name>org.zkoss.zul.nativebar</name>
              <value>false</value>
          </library-property>
      

      Cannot use anymore neither sizedByContent="true" in Listbox/Grid nor hflex="min" in listheader.

      Please check this simple zul.

      <window title="Listbox">
      	<listbox  checkmark="false" multiple="false" style="border:none"  sizedByContent="true">
      		<listhead>
      			<listheader label="Client"  />
      			<listheader label="Description" />
      	    </listhead>
      		
      		<listitem style="white-space: nowrap">
      			<listcell label="XXX" hflex="min" />
      			<listcell label="XXX description" />
             </listitem>			
      	</listbox>
      </window>
      

      simplified:

          <listbox>
              <listhead>
                  <listheader label="Client" hflex="min"/>
              </listhead>
              <listitem>
                  <listcell label="aaa" hflex="min"/>
              </listitem>
          </listbox>
      

      Current Result

      Data are either not displayed properly or even crash with:
      Uncaught TypeError: Cannot read property 'firstChild' of null
      at _calcMinWd (zul.mesh.wpd:62)
      at init._calcMinWds (zul.mesh.wpd:1430)
      at init.beforeMinFlex_ (zul.mesh.wpd:2917)
      at Object.fixMinFlex (zk.wpd:27788)
      at Object.fixFlex (zk.wpd:27678)
      at init.onSize (zk.wpd:27583)
      at _invoke (zk.wpd:15028)
      at init.fire (zk.wpd:15011)
      at _fire (zk.wpd:15154)
      at Object.fireDown (zk.wpd:15371)

      "Error code 3: ZK error, after mounting.
      Something went wrong while loading the page."

      Expected Result

      • no error.
      • show a non-native scrollbar

      debug info

      • since 8.5.2, there is no .z-listheader-bar rendered when navtivebar=false

      Workaround

      see attached zk-4071.js

        Issue Links

          Activity

          There are no comments yet on this issue.

            People

            • Assignee:
              Leon03 Leon03
              Reporter:
              tomekcz tomekcz
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Agile