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

Collapsing a Groupbox with invalidate causes a JavaScript error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 8.6.1
    • 6.5.1, 8.6.0
    • Components

      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)

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