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

Issue with combobox popup during orientation change

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 7.0.6
    • 7.0.5
    • Components
    • Security Level: Jimmy
    • None
    • iPad Air

    • ZK 7.0.7

      Reproducing steps:

      1. Open sample page on a mobile browser
      2. Open combobox popup
      3. Change device orientation
      -> the size and the location of the combobox popup does not change


      Reproducing sample:

      <combobox>
          <comboitem label="Item 1"/>
          <comboitem label="Item 2"/>
          <comboitem label="Item 3"/>
      </combobox>
      

      Workaround:

      Just close the combobox popup on orientation change

      zk.afterLoad('zul.inp,zkmax', function() {
          // WORKAROUND for orientation change issue
          if (zk.ios) {
              window.addEventListener('orientationchange', function() {
                  if (window._openCombobox) {
                      window._openCombobox.close();
                  }
              });
          };
      
          var xCombobox = {};
          zk.override(zul.inp.Combobox.prototype, xCombobox, {            
              
              open: function(opts) {
                  xCombobox.open.apply(this, arguments);
                  
                  // WORKAROUND for orientation change issue
                  if (zk.ios && this._open) {
                      window._openCombobox = this;    
                  }               
              },
              
              close: function(opts) {
                  xCombobox.close.apply(this, arguments);
                  
                  // WORKAROUND for orientation change issue
                  if (zk.ios && !this._open) {
                      window._openCombobox = null;
                  }
              }
          });
      });
      

            ChunfuChang ChunfuChang
            neillee neillee
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 hours
                3h