-
-
Notifications
You must be signed in to change notification settings - Fork 26
[fix] Preserve newline characters in input fields #19 #32
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
base: master
Are you sure you want to change the base?
Conversation
…sp#19 Fixed an issue where newline characters () in input fields were removed when saving via the HTML form. Updated the logic to ensure newline characters are preserved in both display and saved data. Fixed openwisp#19
…sp#19 Fixed an issue where newline characters () in input fields were removed when saving via the HTML form. Updated the logic to ensure newline characters are preserved in both display and saved data. Fixes openwisp#19
\n
) in input fields were removed when saving via the HTML form. Updated the logic to ensure newline characters are preserved in both display and saved data. Fixed #19\n
) in input fields were removed when saving via the HTML form. Updated the logic to ensure newline characters are preserved in both display and saved data. Fixed #19
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The input tag in HTML removes special characters like \n, which was the root cause of this bug. This behavior has now been handled correctly.
@nemesifier can we please merge this? |
@nemesifier Can you please review this! |
\n
) in input fields were removed when saving via the HTML form. Updated the logic to ensure newline characters are preserved in both display and saved data. Fixed #19There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am sorry but we got carried away with other activites with @openwisp and forgot to review this PR.
After looking at this solution, my question is: has anyone understood what causes the bug in the first place?
Yes, I tried checking what happens when you use the \n character inside an input tag ( I don't remember properly but it was some related input or textarea ). |
So his solution simply adds |
[flat-json-widget] Preserve newline characters in input fields (#19)
Description:
This PR fixes an issue where newline characters (
\n
) in input fields were being removed upon saving data through the HTML form. The logic has been updated to ensure that newline characters are preserved correctly in both the display and the saved data.Fixes #19
Checklist:
Testing:
This is my first time creating a PR, and I was trying to follow your contribution guidelines. I mistakenly committed four times, but the main fix is in the first commit. Please review it.