9.9.0 to 9.9.2

keepConnected

Since v9.8.0, the destroy method automatically executes when the cq-context component is disconnected from the DOM.

This presents an issue when moving cq-context within the DOM, as the component becomes non-functional once it is disconnected during the move.


Patch release v9.9.2 introduced the keepConnected function.

keepConnected accepts two parameters: the element to check or set, and an optional boolean indicating whether the destroy() method should execute when cq-context is disconnected from the DOM.

Use this function when moving cq-context within the DOM. Set the second parameter to true before moving the element and to false after to prevent destroy() from executing.

keepConnected can also check if moving an element or any parent elements like cq-context will trigger destroy when moved or disconnected by returning a boolean value.

CIQ.UI.keepConnected(el, val);