diff --git a/assets/js/src/form_editor/store/form_body_to_blocks.jsx b/assets/js/src/form_editor/store/form_body_to_blocks.jsx index ad43e4e825..318200f5a2 100644 --- a/assets/js/src/form_editor/store/form_body_to_blocks.jsx +++ b/assets/js/src/form_editor/store/form_body_to_blocks.jsx @@ -82,7 +82,7 @@ export default (data, customFields = []) => { mapped.attributes.labelWithinInput = !!item.params.label_within; } if (item.params) { - mapped.attributes.label = item.params.label ? item.params.label : null; + mapped.attributes.label = item.params.label ? item.params.label : ''; } switch (item.id) { case 'email': diff --git a/tests/javascript/form_editor/store/form_body_to_blocks.spec.js b/tests/javascript/form_editor/store/form_body_to_blocks.spec.js index 923909a85d..3d5b909b37 100644 --- a/tests/javascript/form_editor/store/form_body_to_blocks.spec.js +++ b/tests/javascript/form_editor/store/form_body_to_blocks.spec.js @@ -224,7 +224,7 @@ describe('Form Body To Blocks', () => { delete input.params.label; const [block] = formBodyToBlocks([{ ...emailInput, position: '1' }]); checkBlockBasics(block); - expect(block.attributes.label).to.be.equal(null); + expect(block.attributes.label).to.be.equal(''); }); it('Should map first name input to block', () => {