Test case
- Create a simple textarea component
- Fill it with a value that contains empty lines:
- Trigger the component update, so
loki_components/index/html ajax call is performed.
Expected result
Textarea preserves the value as it is, with empty lines
Actual result
Empty lines are stripped out of the value. The actual value of the textarea after the update:
Possible solution
The stripping part takes place in this class. It looks like this part of code only intends to normalize the line breaks, and empty line stripping is not intentional. So, possibly, the line
$htmlPart = preg_replace("/([\r\n]+)/", "\n", $htmlPart);
Can be replaced with
$htmlPart = preg_replace("/\r\n|\r/", "\n", $htmlPart);
Test case
loki_components/index/htmlajax call is performed.Expected result
Textarea preserves the value as it is, with empty lines
Actual result
Empty lines are stripped out of the value. The actual value of the textarea after the update:
Possible solution
The stripping part takes place in this class. It looks like this part of code only intends to normalize the line breaks, and empty line stripping is not intentional. So, possibly, the line
Can be replaced with