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

Grid style cause white space in combobox popup

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Normal Normal
    • 8.5.0
    • 8.0.3
    • None
    • Security Level: Jimmy
    • None

      Steps to Reproduce

      run fiddle http://zkfiddle.org/sample/2e4e6jt/3-Combobox-white-space-bug
      open combobox

      Actual Result

      Popup contains white space

      Expected Result

      popup should fit to content

      Debug Info

      during combowidget._fixsz():

      		var pp2 = this.getPopupNode_(true);
      		if (ppofs[1] == 'auto' && pp.offsetHeight > 350) { // offsetHeight is currently larger than 350 because each item's height is currently 24 px, should be 14px
      			pp.style.height = '350px';
      		} else if (pp.offsetHeight < 10) {
      			pp.style.height = '10px'; 
      			
      			if (this._shadow)
      				this._shadow.sync();
      		}
      

      Root Cause

      content of grid rows have a line-height of 24px
      https://github.com/zkoss/zk/blob/634025ec0c5cf6d63cadc31351140cdb5edec9e1/zul/src/archive/web/zul/less/_zkvariables.less#L13
      https://github.com/zkoss/zk/blob/8d4561145acd5f950a3adaac900c7b26ce461b37/zul/src/archive/web/js/zul/grid/less/grid.less#L219

      Workaround

      <style>
      .z-column-content .z-comboitem, .z-row-content .z-comboitem, .z-group-content .z-comboitem, .z-groupfoot-content .z-comboitem, .z-footer-content .z-comboitem {
      line-height: initial;
      }
      </style>
      

            DevChu DevChu
            MDuchemin MDuchemin
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 10 minutes
                10m