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

Firefox default document-level mouseUp event sometime prevents selection in input

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 8.6.1
    • None
    • None
    • Security Level: Jimmy
    • None
    • Firefox 64.0 (64-bit)

    • ZK 8.6.0 S1, ZK 8.6.0 S2, ZK 8.6.1 S1
    • None

      Steps to Reproduce

      Run fiddle
      http://zkfiddle.org/sample/1in4p18/5-Firefox-document-mouseUp-default

      Click in the input in sequence 1 > 2 > 1 > 2 > 1 > 2 > ....
      Note: there is a race condition between server reply and mouseUp.
      To test for this issue, keep the mouse button down without moving the mouse until after the server replies arrive and the content is selected.
      (on local / low latency, server reply will be received first)

      Current Result

      on half the clicks, the input will receive the selection, then loose selection on mouseUp because firefox will trigger caret positioning during mouseUp

      Expected Result

      Firefox should not affect selection during mouseup

      Debug Info

      Root Cause

      Firefox native document-level onMouseUp listener

      Workaround

      prevent FF default mouseUp
      deploy on zul page or globally with lang-addon

      	<script><![CDATA[
      zk.afterLoad('zul.inp', function() {
      	var xInputWidget = {};
      	zk.override(zul.inp.InputWidget.prototype, xInputWidget ,{
      		doBlur_ : function() {
      			var result = xInputWidget.doBlur_.apply(this, arguments);
      			if(zk.ff){
      				this.$n().selectionStart=0;
      				this.$n().selectionEnd=0;
      			}
      			return result;
      		}
      	});//zk.override
      });//zk.afterLoad
      ]]></script>
      

            CharlesQiu CharlesQiu
            MDuchemin MDuchemin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 1 day
                1d
                Remaining:
                Time Spent - 2 hours Remaining Estimate - 6 hours
                6h
                Logged:
                Time Spent - 2 hours Remaining Estimate - 6 hours
                2h