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

Timebox with tablet-ui disabled discard virtual keyboard value on mobile

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 6.5.8.1, 9.5.0.1
    • Fix Version/s: 9.5.1
    • Component/s: Browser Issue, Components
    • Security Level: Jimmy
    • Environment:

      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

    • gh.sprint.customfield.default.name:
      ZK 9.5.1 S1

      Description

      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

      https://github.com/zkoss/zk/blob/fe89147e0fd9826a007424e5bc719177deb56f2b/zul/src/archive/web/js/zul/db/Timebox.js#L506

      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>-->  
      

        Attachments

          Activity

            People

            Assignee:
            rudyhuang rudyhuang
            Reporter:
            MDuchemin MDuchemin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 4 hours Original Estimate - 4 hours
                4h
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 6 hours
                6h