From c2f18dd9e40bcc9eab812212ed5b817efd874d24 Mon Sep 17 00:00:00 2001 From: Prateeksha Singh Date: Wed, 26 Jul 2017 11:50:22 +0530 Subject: [PATCH] [fix] detach instead of emptying parent (#3783) --- frappe/public/js/frappe/form/control.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frappe/public/js/frappe/form/control.js b/frappe/public/js/frappe/form/control.js index 80fbafce4a..a9ada5e180 100755 --- a/frappe/public/js/frappe/form/control.js +++ b/frappe/public/js/frappe/form/control.js @@ -1242,7 +1242,8 @@ frappe.ui.form.ControlAttachImage = frappe.ui.form.ControlAttach.extend({ var me = this; this._super(); - this.container = $('
').appendTo($(this.parent).empty()); + $(this.wrapper).detach(); + this.container = $('
').appendTo($(this.parent)); this.container.attr('data-fieldtype', this.df.fieldtype).append(this.wrapper); if(this.df.align === 'center') { this.container.addClass("flex-justify-center");