Fix min/max ignoring 0 value (#9137)

This commit is contained in:
Charles Gagnon
2020-02-13 11:53:06 -08:00
committed by GitHub
parent 6e5b13ac8f
commit bbf6fcb0fc

View File

@@ -24,6 +24,7 @@ import { KeyCode } from 'vs/base/common/keyCodes';
import * as DOM from 'vs/base/browser/dom';
import { assign } from 'vs/base/common/objects';
import { IComponent, IComponentDescriptor, IModelStore, ComponentEventType } from 'sql/platform/dashboard/browser/interfaces';
import { isNumber } from 'vs/base/common/types';
@Component({
selector: 'modelview-inputBox',
@@ -191,10 +192,10 @@ export default class InputBoxComponent extends ComponentBase implements ICompone
}
private layoutInputBox(): void {
if (this.width) {
if (isNumber(this.width)) {
this.inputElement.width = this.convertSizeToNumber(this.width);
}
if (this.height) {
if (isNumber(this.height)) {
this.inputElement.setHeight(this.convertSize(this.height));
}
}
@@ -215,10 +216,10 @@ export default class InputBoxComponent extends ComponentBase implements ICompone
input.inputElement.type = this.inputType;
if (this.inputType === 'number') {
input.inputElement.step = 'any';
if (this.min) {
if (isNumber(this.min)) {
input.inputElement.min = this.min.toString();
}
if (this.max) {
if (isNumber(this.max === undefined)) {
input.inputElement.max = this.max.toString();
}
}
@@ -229,10 +230,10 @@ export default class InputBoxComponent extends ComponentBase implements ICompone
input.setEnabled(this.enabled);
this.layoutInputBox();
if (this.multiline) {
if (this.rows) {
if (isNumber(this.rows)) {
this.inputElement.rows = this.rows;
}
if (this.columns) {
if (isNumber(this.columns)) {
this.inputElement.columns = this.columns;
}
}