You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using a jQuery object as content ($el.popover( { content: $form } )), the form and form elements lose their bound events on second setContent call. When the popover is shown for second time, for example.
This happens because of a jQuery memory leak fix (explanation here, proof here). jQuery's html() method (used in Popover.prototype.setContent) internally uses this.empty().append( value ); and therefore removes the content before appending it again.
When using a jQuery object as content (
$el.popover( { content: $form } )
), the form and form elements lose their bound events on secondsetContent
call. When the popover is shown for second time, for example.This happens because of a jQuery memory leak fix (explanation here, proof here). jQuery's
html()
method (used inPopover.prototype.setContent
) internally usesthis.empty().append( value );
and therefore removes the content before appending it again.I suggest changing:
Into something like:
Which fixes the issue. Note that even if content is a jQuery object, it is wrapped again, to support DOM nodes and HTML strings.
The text was updated successfully, but these errors were encountered: