input number select value when is zero
gitea/salix/dev This commit looks good Details

This commit is contained in:
Joan Sanchez 2019-04-11 08:05:46 +02:00
parent 3fbdd3a186
commit 1dd8fdd96b
1 changed files with 3 additions and 2 deletions

View File

@ -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');