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

zEmbedded destroy doesn't remove Desktop from the zk.Desktop.all collection, cause unwanted events

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 9.6.0.1
    • Fix Version/s: 9.6.2
    • Component/s: None
    • Security Level: Jimmy
    • Labels:

      Description

      Steps to Reproduce

      Run an embedded ZK app

      Run the zEmbedded.destroy(containerId) command at client-side to destroy the ZK app

      Current Result

      zk.Desktop.all[dtid] still exists.

      If an external script cause a global invocation of window listeners such as bookmark change or popHistoryState, since there is no valid desktop as target of the global invocation, the zAu.send function will loop over the Desktops in zk.Desktop.all and fire events to each, which include the currently removed desktop.

      Expected Result

      Destroyed desktops cannot receive events

      Debug Information

      https://github.com/zkoss/zk/blob/master/zk/src/archive/web/js/zk/au.ts#L460

      Workaround

      remove the desktop from zk.Desktop.all manually upon calling zEmbedded.destroy()

        Attachments

          Activity

            People

            Assignee:
            DevChu DevChu
            Reporter:
            MDuchemin MDuchemin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: