From 1dd8fdd96b06ce2693ddd38f37720a3d9515fdd1 Mon Sep 17 00:00:00 2001 From: Joan Sanchez Date: Thu, 11 Apr 2019 08:05:46 +0200 Subject: [PATCH] input number select value when is zero --- front/core/components/input-number/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/front/core/components/input-number/index.js b/front/core/components/input-number/index.js index 2e4e73c29..19c28a63d 100644 --- a/front/core/components/input-number/index.js +++ b/front/core/components/input-number/index.js @@ -44,11 +44,12 @@ export default class InputNumber extends Input { * @param {Number} value - Value */ set value(value) { - if (!this.hasOwnProperty('_value') && value) + this.hasValue = !(value === null || value === undefined || value === ''); + + if (!this.hasOwnProperty('_value') && this.hasValue) this.input.value = value; this._value = value; - this.hasValue = !(value === null || value === undefined || value === ''); if (this.hasValue) this.element.classList.add('not-empty');