diff --git a/packages/vanilla/src/cells/IntegerCell.tsx b/packages/vanilla/src/cells/IntegerCell.tsx index a2ecf6a37..0d95b9667 100644 --- a/packages/vanilla/src/cells/IntegerCell.tsx +++ b/packages/vanilla/src/cells/IntegerCell.tsx @@ -40,7 +40,7 @@ export const IntegerCell = (props: CellProps & VanillaRendererProps) => { handleChange(path, parseInt(ev.target.value, 10))} className={className} id={id} diff --git a/packages/vanilla/test/renderers/IntegerCell.test.tsx b/packages/vanilla/test/renderers/IntegerCell.test.tsx index 496158331..57a583949 100644 --- a/packages/vanilla/test/renderers/IntegerCell.test.tsx +++ b/packages/vanilla/test/renderers/IntegerCell.test.tsx @@ -351,4 +351,15 @@ describe('Integer cell', () => { const input = wrapper.find('input').getDOMNode() as HTMLInputElement; expect(input.disabled).toBe(false); }); + + test('shows 0 instead of empty string', () => { + const core = initCore(fixture.schema, fixture.uischema, { foo: 0 }); + wrapper = mount( + + + + ); + const input = wrapper.find('input').getDOMNode() as HTMLInputElement; + expect(input.value).toBe('0'); + }); });