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

Collapsing a Groupbox with invalidate causes a JavaScript error

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 6.5.1, 8.6.0
    • Fix Version/s: 8.6.1
    • Component/s: Components
    • Labels:

      Description

      Steps to Reproduce

      1. collapse groupbox
        <zk>
            <groupbox title="Groupbox"
                      onOpen="self.invalidate();">
                <button label="test button" />
            </groupbox>
        </zk>
        

      Current Result

      An error in browser console

      TypeError: btn is undefined

      Expected Result

      No error in browser console

      Debug Information

      It tried to restore the focus, but the cave node is empty in collapsed groupbox.
      Button isn't aware this and use this.$n() (=null)
      https://github.com/zkoss/zk/blob/v8.6.0.1/zul/src/archive/web/js/zul/wgt/Button.js#L231

      Workaround

      Avoid calling invalidate if an animation is included in a action.
      Use <caption> instead of title attribute. (Because you clicked caption, not groupbox itself)

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  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