From 6a34c6118140dfdd4fabd09528cf4721aa895bdc Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 24 Dec 2020 16:17:30 +0300 Subject: [PATCH] [DE] Fix changing focus on form settings panel --- apps/documenteditor/main/app/view/FormSettings.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/documenteditor/main/app/view/FormSettings.js b/apps/documenteditor/main/app/view/FormSettings.js index 767d0fbc8..3b840022b 100644 --- a/apps/documenteditor/main/app/view/FormSettings.js +++ b/apps/documenteditor/main/app/view/FormSettings.js @@ -341,22 +341,24 @@ define([ }, onPlaceholderChanged: function(input, newValue, oldValue, e) { - if (this.api && !this._noApply) { + if (this.api && !this._noApply && (newValue!==oldValue)) { var props = this._originalProps || new AscCommon.CContentControlPr(); props.put_PlaceholderText(newValue || ' '); this.api.asc_SetContentControlProperties(props, this.internalId); - this.fireEvent('editcomplete', this); + if (!e.relatedTarget || (e.relatedTarget.localName != 'input' && e.relatedTarget.localName != 'textarea') || !/form-control/.test(e.relatedTarget.className)) + this.fireEvent('editcomplete', this); } }, onHelpChanged: function(input, newValue, oldValue, e) { - if (this.api && !this._noApply) { + if (this.api && !this._noApply && (newValue!==oldValue)) { var props = this._originalProps || new AscCommon.CContentControlPr(); var formPr = this._originalFormProps || new AscCommon.CSdtFormPr(); formPr.put_HelpText(newValue); props.put_FormPr(formPr); this.api.asc_SetContentControlProperties(props, this.internalId); - this.fireEvent('editcomplete', this); + if (!e.relatedTarget || (e.relatedTarget.localName != 'input' && e.relatedTarget.localName != 'textarea') || !/form-control/.test(e.relatedTarget.className)) + this.fireEvent('editcomplete', this); } },