From deaf81e214d7df2eab3548891045d9f7c9cca7e0 Mon Sep 17 00:00:00 2001 From: Jon Ziebell Date: Wed, 29 Jan 2020 21:33:17 -0500 Subject: [PATCH] Fixed bug in Chrome when clicking from the download data input directly on a button --- js/component/input/text.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/js/component/input/text.js b/js/component/input/text.js index 9f189bb..0cae499 100644 --- a/js/component/input/text.js +++ b/js/component/input/text.js @@ -38,9 +38,7 @@ beestat.component.input.text.prototype.decorate_ = function(parent) { 'border': 'none', 'background': beestat.style.color.bluegray.light, 'border-radius': beestat.style.size.border_radius, - // 'border-bottom': ('1px solid ' + beestat.style.color.gray.dark), 'padding': (beestat.style.size.gutter / 2), - // 'background': 'none', 'color': '#fff', 'outline': 'none', 'transition': 'background 200ms ease' @@ -68,7 +66,9 @@ beestat.component.input.text.prototype.decorate_ = function(parent) { 'padding-left': '24px' }); - (new beestat.component.icon(this.icon_).set_size(16).set_color('#fff')).render(icon_container); + (new beestat.component.icon(this.icon_).set_size(16) + .set_color('#fff')) + .render(icon_container); } if (this.value_ !== undefined) { @@ -79,14 +79,19 @@ beestat.component.input.text.prototype.decorate_ = function(parent) { }; /** - * Set the value in the input field. + * Set the value in the input field. This bypasses the set_ function to avoid + * rerendering when the input value is set. It's unnecessary and can also + * cause minor issues if you try to set the value, then do something else with + * the input immediately after. * * @param {string} value * * @return {beestat.component.input.text} This. */ beestat.component.input.text.prototype.set_value = function(value) { - return this.set_('value', value); + this.value_ = value; + this.input_.value(value); + return this; }; /**