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

Dropdown list inside a grid automatically closes when moused out [FF]

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Normal Normal
    • None
    • 7.0.0, 7.0.1, 7.0.2
    • General
    • Security Level: Jimmy

      The issue seemed to appear in Firefox, and not in Chrome.

      1. Open the dropdown list
      2. Move the mouse cursor outside the dropdown list

      The dropdown list would automatically close, and appear to select something, but does not.

      test.zul
      <grid>
          <columns>
              <column />
          </columns>
          <rows>
              <row>
                  <listbox mold="select" onSelect='alert("onSelect fired");'>
                      <listitem><listcell label="1" /></listitem>
                      <listitem><listcell label="2" /></listitem>
                      <listitem><listcell label="3" /></listitem>
                      <listitem><listcell label="4" /></listitem>
                      <listitem><listcell label="5" /></listitem>
                  </listbox>
              </row>
          </rows>
      </grid>
      

      A workaround is to apply the following script to the listbox.

      Workaround
      <grid xmlns:w="client">
          ...
                  <listbox mold="select">
                  <attribute w:name="onBind"><![CDATA[
                  if (zk.ff && this.desktop) {
                      var n = this.$n(),
                          p = n.parentNode, $p;
                      if (p) {
                          $p = jq(p);
                      }
                      
                      while ($p) {
                          if ($p.hasClass('z-row-inner')) {
                              $p.removeClass('z-row-inner');
                              break;
                          }
                          $p = $p.parent();
                      }
                  }]]></attribute>
                  ...
                  </listbox>
          ...
      </grid>
      

            jumperchen jumperchen
            neillee neillee
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: