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

2nd popup open by click menu item on 1st popup will close immediiate (on fast bandwidth)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 9.6.0
    • 9.5.0.2
    • Components
    • Security Level: Jimmy
    • None
    • firefox 78
      linux (debian mint 4 LMDE Debbie)
      local or intranet or fast internet

      Steps to Reproduce

      code at https://zkfiddle.org/sample/1615786/4

      <vbox>
          <toolbarbutton label="click me to show main popup" onClick="showMainPopup()" image="https://www.zkoss.org/zksandbox/img/Centigrade-Widget-Icons/ArrowDown-16x16.png"/>
      
      	<button id="showHere" label="Below" image="https://www.zkoss.org/zksandbox/img/Centigrade-Widget-Icons/ArrowDown-16x16.png" width="125px" />
      	
        	<menupopup id="ppMain" width="300px">
          	<menuitem label="just test" />
          	<menuitem label="just test" />
          	<menuitem label="just test" />
          	<menuitem label="just test" />
          	<menuitem label="click me to show other popup" onClick="showNewPopup()" image="https://www.zkoss.org/zksandbox/img/Centigrade-Widget-Icons/ArrowDown-16x16.png" />
        	</menupopup>
        
        	<menupopup id="ppNew" width="300px">
          	<menuitem label="just test" image="https://www.zkoss.org/zksandbox/img/Centigrade-Widget-Icons/ArrowDown-16x16.png" />
        	</menupopup>
      
      <zscript>
      	<![CDATA[	
      		public void showMainPopup(){
      			ppMain.open (showHere, "after_start");
      		}
      		public void showNewPopup(){
      			ppNew.open (showHere, "after_start");
      		}
      	]]>
      </zscript>
      </vbox>
      

      1. click button 1 to show popup 1 on button 2
      popup 1 has a menu item
      2. click menu item to show popup 2

      Current Result

      popup 2 shows but immediately closes

      Expected Result

      popup 2 shows and remains visible

      Debug Information

      1. on zkfiddle, the issue does not happen because the network is slow
      but when run on local then issue happen on firefox (chrome does not get the issue)
      2. firefox 85 + Mac can also produce this bug
      3. can reproduce it with 9.5.1.FL.20210219-Eval

      Workaround

      sleep about 200milisecond at server when handle menuitem click will help
      try

      { Thread.sleep(200); }

      catch (InterruptedException ex)

      { // safe to ignore }

            DevChu DevChu
            hiepgau hiepgau
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: