From 78d6f02765a313ba9c511a629a47f9669a01837f Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Mon, 15 Jan 2024 22:35:47 +0300 Subject: [PATCH] [SSE] Fix Bug 65882 --- .../main/app/view/FillSeriesDialog.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/view/FillSeriesDialog.js b/apps/spreadsheeteditor/main/app/view/FillSeriesDialog.js index 3dec4bfa73..195fcc08d7 100644 --- a/apps/spreadsheeteditor/main/app/view/FillSeriesDialog.js +++ b/apps/spreadsheeteditor/main/app/view/FillSeriesDialog.js @@ -242,6 +242,10 @@ define([ }).on('changed:after', function() { me.isStepChanged = true; }); + this.inputStep._input.on('input', function (e) { + me.isInputStepFirstChange && me.inputStep.showError(); + me.isInputStepFirstChange = false; + }); this.inputStop = new Common.UI.InputField({ el : $window.find('#fill-input-stop-value'), @@ -251,6 +255,10 @@ define([ }).on('changed:after', function() { me.isStopChanged = true; }); + this.inputStop._input.on('input', function (e) { + me.isInputStopFirstChange && me.inputStop.showError(); + me.isInputStopFirstChange = false; + }); this.afterRender(); }, @@ -330,21 +338,24 @@ define([ }, isValid: function() { + var regstr = new RegExp('^\s*[+-]?([0-9]+([.][0-9]*)?|[.][0-9]+)\s*$'); if (this.isStepChanged) { var value = this.inputStep.getValue(); (typeof value === 'string') && (value = value.replace(',','.')); - if (value!=='' && isNaN(parseFloat(value))) { + if (value!=='' && (!regstr.test(value.trim()) || isNaN(parseFloat(value)))) { this.inputStep.showError([this.txtErrorNumber]); this.inputStep.focus(); + this.isInputStepFirstChange = true; return false; } } if (this.isStopChanged) { var value = this.inputStop.getValue(); (typeof value === 'string') && (value = value.replace(',','.')); - if (value!=='' && isNaN(parseFloat(value))) { + if (value!=='' && (!regstr.test(value.trim()) || isNaN(parseFloat(value)))) { this.inputStop.showError([this.txtErrorNumber]); this.inputStop.focus(); + this.isInputStopFirstChange = true; return false; } }