From 13494b21d9b818e96fea83623839248420346014 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 10 Dec 2019 12:13:52 +0300 Subject: [PATCH] Fix spinner component for firefox: deselect text on blur --- apps/common/main/lib/component/MetricSpinner.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/common/main/lib/component/MetricSpinner.js b/apps/common/main/lib/component/MetricSpinner.js index 673847da4..03e470211 100644 --- a/apps/common/main/lib/component/MetricSpinner.js +++ b/apps/common/main/lib/component/MetricSpinner.js @@ -145,7 +145,12 @@ define([ if (!this.options.allowDecimal) el.on('keypress', '.form-control', _.bind(this.onKeyPress, this)); el.on('focus', 'input.form-control', function() { - me.$input && me.$input.select(); + setTimeout(function(){me.$input && me.$input.select();}, 1); + }); + Common.Utils.isGecko && el.on('blur', 'input.form-control', function() { + setTimeout(function(){ + me.$input && (me.$input[0].selectionStart = me.$input[0].selectionEnd = 0); + }, 1); }); this.switches = {