0

I have a content-editable div in a html page and i have loaded it to UWP WebView. When i edit the content say i enter "Apple" and press enter new line(\n) is getting added but in the edge browser a new line div>br>/div> gets added. Why its behaving differently. I am facing problems in doing text formatting in the webview because of this problem. The problem is when i enter few lines and then when i try add a new list(ordered/unordered) all the lines above are considered as list(as they are considered as same div). Attached screen shots for reference. Please help me with this issue.edge browser behaviour

Saravana Kumar
  • 341
  • 3
  • 14

1 Answers1

1

Each browser handles enters in editable <div> differently so if you want to have control over it, try using the solution shown here.

Martin Zikmund
  • 38,440
  • 7
  • 70
  • 91
  • Appreciate your quick response. I tried the solution proposed in the link, actually it adds a
    tag after i press enter, i want to encapsulate the line content inside a div. For example im typing "Hello" and the press enter the content has to be encapsulated in
    Hello
    just like a pragraph.
    – Saravana Kumar Jul 18 '18 at 13:06
  • I understand, but you might be able to do that as well - get the parent `
    ` and just edit the inner HTML. I cannot confirm 100% as I am not at my PC, but it might be possible in JavaScript. But I am not sure if that will not affect the "cursor" there
    – Martin Zikmund Jul 18 '18 at 13:59