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

ZK animation uses "complete" callback. should use always instead

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 8.6.2
    • 8.6.1
    • None
    • Security Level: Jimmy
    • None
    • ZK 8.6.2 S1, ZK 8.6.2 S2
    • None

      Debug Info

      https://github.com/zkoss/zk/blob/4efeeef5c4671a42e563e05a31d1797a75b10e01/zk/src/archive/web/js/zk/anima.js#L199-L203

      animate() calls that use a complete:callback as part of the option list will trigger the callback if the animation completes successfully.
      If the animation ends without completing for any reason (browser handling, property error, interupted, etc), the complete:callback will not be invoked, which prevents the animated component from triggering afterAnima (or any other relevant post-animation logic).

      Root Cause

      Solution

      JQ animate supports the always:callback in addition to complete:callback
      always will always be trigger when the animation finishes, regardless of state. (It acts as a "finally" block)
      As such, it should be prefered for callbacks that needs to be invoked at the end of the animation.

            Leon03 Leon03
            MDuchemin MDuchemin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 4 hours
                4h
                Remaining:
                Time Spent - 3 hours Remaining Estimate - 1 hour
                1h
                Logged:
                Time Spent - 3 hours Remaining Estimate - 1 hour
                3h