-
Bug
-
Resolution: Fixed
-
Normal
-
6.5.8.1, 9.5.0.1
-
Security Level: Jimmy
-
reproducing on chrome mobile
CHROME 86.0.4240.185
on android
Android 10; SM-A505GN Build QP1A.190711.020
doesn't reproduce on desktop chrome with emulation mode, Firefox on Android, and iPad mini chrome
-
ZK 9.5.1 S1
-
None
Steps to Reproduce
Must run on mobile with tablet-ui disabled
Run code on mobile phone:
<zk xmlns:w="client"> <!-- <script><![CDATA[ zk.afterLoad("zul.db", function () { var _xTimebox = {}; zk.override(zul.db.Timebox.prototype, _xTimebox, { doBlur_: function (evt) { // skip onchange, Bug 2936568 if (!this._value && !this._changed && zul.db.Timebox._unformater && ! zk.mobile) this.getInputNode().value = this._defRawVal = ''; this.$supers('doBlur_', arguments); zul.inp.RoundUtl.doBlur_(this); } }); }); ]]></script>--> <zscript> org.zkoss.lang.Library.setProperty("org.zkoss.zkmax.tablet.ui.disabled", "true"); </zscript> <timebox buttonVisible="false" onChange="System.out.println(event.getValue().toString())"></timebox> </zk>
Tap on timebox and edit the value
Tap out of the timebox to trigger blur
Current Result
onChange event is not sent, input value is reset to ""
Expected Result
onChange is sent, input value is not reset to ""
Debug Information
if (!this._value && !this._changed && !Timebox._unformater) this.getInputNode().value = this._defRawVal = '';
This is triggered during blur, reseting the value, preventing use of the timebox
Workaround
disabled the check for zk.mobile
<zk xmlns:w="client"> <!-- <script><![CDATA[ zk.afterLoad("zul.db", function () { var _xTimebox = {}; zk.override(zul.db.Timebox.prototype, _xTimebox, { doBlur_: function (evt) { // skip onchange, Bug 2936568 if (!this._value && !this._changed && zul.db.Timebox._unformater && ! zk.mobile) this.getInputNode().value = this._defRawVal = ''; this.$supers('doBlur_', arguments); zul.inp.RoundUtl.doBlur_(this); } }); }); ]]></script>-->
- relates to
-
ZK-5778 Automatically change input method when focusing specific input
- Open