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

IE11 trigger opens comboWidget popup when loading if contain unicode characters

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: 9.5.0
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Steps to Reproduce

      https://zkfiddle.org/sample/2e9qh6b/2-Combobox-Autodrop-IE11

      run in IE11

      Current Result

      When page loads, the popup is open

      Expected Result

      Popup only opens when user triggers it

      Debug Information

      https://answers.microsoft.com/en-us/ie/forum/all/ie-10-11-input-elements-with-unicode-entity/de997de8-3e94-44b8-b7e3-c5291a87c920

       

      side effect of https://tracker.zkoss.org/browse/ZK-3702

      relevant: https://tracker.zkoss.org/browse/ZK-3183

      Workaround

      Restore previous key handling (also restore ZK-3702 issue: popup trigger on non content keys such as num-lock or volume keys)

      <script><![CDATA[
          zk.afterLoad("zul.inp", function () {
              var _xComboWidget = {};
              zk.override(zul.inp.ComboWidget.prototype, _xComboWidget, {
                  bind_: function () {
                      this.$supers(zul.inp.ComboWidget, 'bind_', arguments);
                      var btn, inp = this.getInputNode();
          
                      if (btn = this.$n('btn')) {
                          this.domListen_(btn, zk.android ? 'onTouchstart' : 'onClick', '_doBtnClick');
                          if (this._inplace) this.domListen_(btn, 'onMouseDown', '_doBtnMouseDown');
                      }
          
                      zWatch.listen({onSize: this, onFloatUp: this, onResponse: this, onScroll: this});
                      if (!zk.css3) jq.onzsync(this);
                  },
                  unbind_: function () {
                      this.close();
          
                      var btn = this.$n('btn');
                      if (btn) {
                          this.domUnlisten_(btn, zk.android ? 'onTouchstart' : 'onClick', '_doBtnClick');
                          if (this._inplace) this.domUnlisten_(btn, 'onMouseDown', '_doBtnMouseDown');
                      }
          
                      zWatch.unlisten({onSize: this, onFloatUp: this, onResponse: this, onScroll: this});
                      if (!zk.css3) jq.unzsync(this);
          
                      this.$supers(zul.inp.ComboWidget, 'unbind_', arguments);
                  },
                  _doKeyDown: function (evt) {
                      var keyCode = evt.keyCode,
                          bOpen = this._open;
                          // Bug ZK-475, ZK-3635
                      if (evt.target == this && (keyCode == 9 || (zk.webkit && keyCode == 0))) { //TAB or SHIFT-TAB (safari)
                          if (bOpen)
                              this.close({sendOnOpen: true});
                          return;
                      }                if (evt.altKey && (keyCode == 38 || keyCode == 40)) {//UP/DN
                          if (bOpen) this.close({sendOnOpen: true});
                          else this.open({sendOnOpen: true});                    //FF: if we eat UP/DN, Alt+UP degenerate to Alt (select menubar)
                          var opts = {propagation: true};
                          if (zk.ie < 11) opts.dom = true;
                          evt.stop(opts);
                          return;
                      }                //Request 1537962: better responsive
                      if (bOpen && (keyCode == 13 || keyCode == 27)) { //ENTER or ESC
                          if (keyCode == 13) this.enterPressed_(evt);
                          else this.escPressed_(evt);
                          return;
                      }                if (keyCode == 18 || keyCode == 27 || keyCode == 13
                      || (keyCode >= 112 && keyCode <= 123)) //ALT, ESC, Enter, Fn
                          return; //ignore it (doc will handle it)                if (this._autodrop && !bOpen)
                          this.open({sendOnOpen: true});                if (keyCode == 38) this.upPressed_(evt);
                      else if (keyCode == 40) this.dnPressed_(evt);
                      else this.otherPressed_(evt);
                  }
               });
          });
      ]]></script>
      

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            MDuchemin MDuchemin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: