Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Value attribute for TextArea control is a input[type=text] and not textarea/div[contenteditable] leading to removal of new lines #699

Closed
sergioralmeida opened this issue Feb 2, 2018 · 5 comments · Fixed by #1487

Comments

@sergioralmeida
Copy link

We can write new lines (hit the "enter" button) on the textarea, but it doesn't save them.
You can try this on the demo page.
1 - https://formbuilder.online/
2 - Add a textarea
3 - Write something with multiple lines
4 - Save
5 - Weep

image

Value is saved with all lines together, not even a tiny space between characters.

image

Any ideas to fix this are highly appreciated. Cheers.

@YaroslavPetryk
Copy link

you need at first before sending to encodeURIcomponent(message), then when you recieve the message decodeURIComponent(message); then message.replace(/%0A/g, "
");

@kevinchappell kevinchappell self-assigned this Nov 3, 2018
@Jojoshua
Copy link
Collaborator

Is this still an issue?

@lucasnetau
Copy link
Collaborator

The value field is a a input[type=text] element which can only take single line text. So when we sync the value of the preview textarea to the value field the \n newlines are removed.

fieldVal.value = e.target.value

@temamagic
Copy link

Also in edit mode, we have single line input instead textarea
image

@lucasnetau lucasnetau changed the title Textarea doensn't save new lines Value attribute for TextArea control is a input[type=text] and not textarea/div[contenteditable] leading to removal of new lines Oct 5, 2023
kevinchappell added a commit that referenced this issue Dec 8, 2023
Copy link

github-actions bot commented Dec 8, 2023

🎉 This issue has been resolved in version 3.17.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants