I'm implementing a custom editor that uses rows of
contenteditable divs. I'm having trouble implementing the right behavior for the 'up' or 'down' key.
When the 'up' key is pressed, I need to detect whether the caret is on the first line of text, and move the caret to the div above. Likewise for the 'down' key and the last line of text.