OpenUI5 version: 1.71.4
Browser/version (+device/version): Version 80.0.3987.100 (Official Build) (64-bit)
Any other tested browsers/devices(OK/FAIL): IE 11
URL (minimal example if possible):
User/password (if required and possible - do not post any confidential information here):
Steps to reproduce the problem:
What is the expected result?
After focus out there should be 3 line break
What happens instead?
on focus every time one line break is reducing.
Any other information? (attach screenshot if possible)
4 line beak

3line break

2 line break remaining

Above issue is occur when TextArea is binded with json model
Hi @jagtrasingh,
can I, please, see the model, you are using, to check the formatting there?
Thank you!
Kind regards,
Petya Bogdanova.
(UI5 Dispatcher)
Yes sure
In declaration component.js
this.setModel(new sap.ui.model.json.JSONModel({
results: []
}), "oModel");
In View i binded as below
In Controller i implemented below code to achieve one functionality
var textArea = this.getView().byId("supplierTextArea"); //this.byId("supplierTextArea");
var idTextArea = textArea.sId + "-inner";
var jQueryId = "#" + idTextArea;
textArea.addEventDelegate({
onfocusout: function () {
cursorPos = $(jQueryId).prop('selectionStart'); // $('#__xmlview1--supplierTextArea-inner').prop('selectionStart');
}
});
In Console when i check its showing 2 new line even i entered 3 times

Even if i not binded with any model moving to new page then come back at same page one new line is reduced every time
onpage 1 showing correct on focus out also showing correct

Navigating to page 2 and come back at same page (Home Page)

Shall i create dummy project and share with you if want to debug
That's a known issue of the native <textarea> element in HTML5. It 'eats' one leading newline each time. See e.g. https://stackoverflow.com/questions/15529500/html-textarea-ignores-1st-new-line-character-why .
Not sure whether sap.m.TextArea should/can compensate this strange issue. Maybe control developers can comment on this.
Thanks
Hint for the UI5 dispatcher: this issue has been discussed in the past already in the internal incident 1980200585.
Thanks a lot