From f7d5b19da17c1b139b5f50cf5f91ec2b2e9c0b17 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 6 Dec 2019 14:55:53 +0300 Subject: [PATCH] Fix Bug 43396: select text in metric spinner on focus --- apps/common/main/lib/component/MetricSpinner.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/common/main/lib/component/MetricSpinner.js b/apps/common/main/lib/component/MetricSpinner.js index 51b9a38f7..673847da4 100644 --- a/apps/common/main/lib/component/MetricSpinner.js +++ b/apps/common/main/lib/component/MetricSpinner.js @@ -144,6 +144,9 @@ 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() { + me.$input && me.$input.select(); + }); this.switches = { count: 1, @@ -480,6 +483,8 @@ define([ _step: function (type, suspend) { (type) ? this._increase(suspend) : this._decrease(suspend); + if (this.options.hold && this.switches.fromKeyDown) + this.$input && this.$input.select(); }, _add: function (a, b, precision) {