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

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 9.6.2
    • 9.6.0.1
    • None
    • Security Level: Jimmy

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

            DevChu DevChu
            MDuchemin MDuchemin
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: