Why Is My Contenteditable caret Jumping to the End in Chrome?

后端 未结 6 1620
攒了一身酷
攒了一身酷 2020-12-10 01:59

Scenario

I have a contenteditable

area, and within this area I may have some
6条回答
  •  臣服心动
    2020-12-10 02:14

    Just add a new line char (\n) before closing the contenteditable tag. For example in JavaScript: var html = '

    ' + content + "\n" + '
    '

提交回复
热议问题