RSS Feed/News Post preview loses registered event listeners for rendered bb-code preview

Status
Not open for further replies.

ENXF NET

Administrator
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P.S Member
S.V.I.P Member
V.I.P Member
Collaborate
Registered
Joined
Nov 13, 2018
Messages
27,341
Points
823

Reputation:

While technically xf-init is executed, any event listeners are lost probably resulting in the results of xf-init being GC'ed. The problem is the use of innerHTML to copy data into the DOM, as this creates new nodes and doesn't move/copy the existing nodes.

This is noticeable for custom bb-code which has xf-init handlers, and xf-init is executed on content which is then dropped.

Code:

Code:
function toPreview (previewHtml)
{
    const previewBox = getPreviewBox()...

Read more

Continue reading...
 
Status
Not open for further replies.
Top