Closed vdineva closed 3 weeks ago
This is not a magna-react specific issue, but a consequence of JavaScript.
Trying the same steps in https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/text gives the same result - the behavior is part of how input fields and the value works.
I'd suggest manually cleaning up input data with
(str) => str.replace(/\\n/g, '\n')
Note that some platforms use \r
for a newline, but I'm not sure if that would apply to the values in this scenario.
Marking this as won't fix since magna shouldn't be modifying data outside of what is native to JavaScript.
Type into a ATextInput component the value 123.
In the console, use vanilla js to get the value of the field
Observe it is returned as it should - 123
Type into a ATextInput component the value 123\n
In the console, use vanilla js to get the value of the field
Observe it is returned as "123\\n"
Expected behavior: the value is returned as "123\n"
related issue in the monorepo: https://cisco-sbg.atlassian.net/browse/XDR-4715