mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-21 15:33:23 +01:00
Api: Fix Et2Number could not display empty value (""), gave 0 instead.
This commit is contained in:
parent
cad474701e
commit
5be31ead6c
@ -236,7 +236,7 @@ export class Et2Number extends Et2Textbox
|
|||||||
val = parseFloat(val);
|
val = parseFloat(val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(isNaN(val))
|
if(val == "" || isNaN(val))
|
||||||
{
|
{
|
||||||
super.value = val;
|
super.value = val;
|
||||||
this.requestUpdate("value", old);
|
this.requestUpdate("value", old);
|
||||||
|
@ -63,7 +63,13 @@ describe("Number widget", () =>
|
|||||||
element.precision = 0;
|
element.precision = 0;
|
||||||
element.value = "1,234";
|
element.value = "1,234";
|
||||||
assert.equal(element.value, "1", "Wrong number of decimals (, separator)");
|
assert.equal(element.value, "1", "Wrong number of decimals (, separator)");
|
||||||
})
|
});
|
||||||
|
|
||||||
|
it("handles blank ('')", () =>
|
||||||
|
{
|
||||||
|
element.value = "";
|
||||||
|
assert.equal(element.value, "");
|
||||||
|
});
|
||||||
|
|
||||||
it("Min limit", () =>
|
it("Min limit", () =>
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user