From 113545bea7580e1603a3c9f37fc1278e4cc20d25 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 26 May 2022 22:36:49 +0300 Subject: [PATCH] Fix Bug 57321 --- apps/common/main/lib/component/MetricSpinner.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/common/main/lib/component/MetricSpinner.js b/apps/common/main/lib/component/MetricSpinner.js index b70974942..e44b19381 100644 --- a/apps/common/main/lib/component/MetricSpinner.js +++ b/apps/common/main/lib/component/MetricSpinner.js @@ -147,8 +147,13 @@ define([ el.on('input', '.form-control', _.bind(this.onInput, this)); if (!this.options.allowDecimal) el.on('keypress', '.form-control', _.bind(this.onKeyPress, this)); - el.on('focus', 'input.form-control', function() { - setTimeout(function(){me.$input && me.$input.select();}, 1); + el.on('focus', 'input.form-control', function(e) { + setTimeout(function(){ + if (me.$input) { + me.$input[0].selectionStart = 0; + me.$input[0].selectionEnd = me.$input.val().length; + } + }, 1); }); Common.Utils.isGecko && el.on('blur', 'input.form-control', function() { setTimeout(function(){