Re: [editing] Should the caret move by default, and should we define this behavior? (#58)

> Does there exist an open-source implementation that moves the caret in block-direction in an arbitrarly styled HTML content?

@ctalau: Yes

* The Aloha editor 2.0 [1] is GPL and it is built on top of standard selections but without contenteditable drawing their own caret, so they must do this themselves (btw, they don't do it well yet). Their solution is to only allow one caret position per collapsed range (at start of line rather than the end), which means they don't have to deal with the problem of not knowing where the caret is placed.
* CodeMirror [2] is licensed MIT can do block direction movement of the caret the way you showed in your demo. It has used several techniques to make editing work, and lately it has introduced contenteditable as part of one their modes , but it's still hidden and you don't get to see the contenteditable part directly. They solve the block-moving issue by controlling line breaking as well as the caret themselves in JS. I don't even know if they use the normal selection API.  

[1] http://www.alohaeditor.org/demo/aloha-ui/
[2] http://codemirror.net/demo/variableheight.html

---
Reply to this email directly or view it on GitHub:
https://github.com/w3c/editing/issues/58#issuecomment-108987484

Received on Thursday, 4 June 2015 17:41:28 UTC