behance/assets-lib — pull request #31 by Aintaer (2014-04-15 21:34:21+00:00)
Title: tagify: working around contenteditable cursor

In order to correctly position the cursor in a contenteditable element, the
browsers display the cursor only when there is an element to properly flow
inside the contenteditable.

For Firefox, this is a
. This
sticks to the end of the
contenteditable and does not disappear. For webkits, this is likewise a
,
but as you start typing, the
will become replaced with the TextNode
containing your text content. We then rely on input event to check to see if
we need to manually inject a
.

Finally upon creation of a tag, we focus on the
so as to position the
cursor correctly.