-
Bug
-
Resolution: Fixed
-
Normal
-
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>
- relates to
-
ZK-3992 InputWidget uses setSelectionRange instead of select in inputWidget.select()
- Closed