fix(ivy): fix style prop instructions to account for zero-based values (#27270)
PR Close #27270
This commit is contained in:
parent
d84705121a
commit
a082f6484a
|
@ -1220,7 +1220,7 @@ export function elementStyleProp(
|
||||||
return hackImplementationOfElementStyleProp(
|
return hackImplementationOfElementStyleProp(
|
||||||
index, styleIndex, value, suffix, directive); // supported in next PR
|
index, styleIndex, value, suffix, directive); // supported in next PR
|
||||||
let valueToAdd: string|null = null;
|
let valueToAdd: string|null = null;
|
||||||
if (value) {
|
if (value !== null) {
|
||||||
if (suffix) {
|
if (suffix) {
|
||||||
// when a suffix is applied then it will bypass
|
// when a suffix is applied then it will bypass
|
||||||
// sanitization entirely (b/c a new string is created)
|
// sanitization entirely (b/c a new string is created)
|
||||||
|
|
|
@ -1459,6 +1459,10 @@ describe('render3 integration test', () => {
|
||||||
fixture.update();
|
fixture.update();
|
||||||
expect(fixture.html).toEqual('<span style="font-size: 200px;"></span>');
|
expect(fixture.html).toEqual('<span style="font-size: 200px;"></span>');
|
||||||
|
|
||||||
|
fixture.component.time = 0;
|
||||||
|
fixture.update();
|
||||||
|
expect(fixture.html).toEqual('<span style="font-size: 0px;"></span>');
|
||||||
|
|
||||||
fixture.component.time = null;
|
fixture.component.time = null;
|
||||||
fixture.update();
|
fixture.update();
|
||||||
expect(fixture.html).toEqual('<span></span>');
|
expect(fixture.html).toEqual('<span></span>');
|
||||||
|
|
Loading…
Reference in New Issue