Skip to content

Commit

Permalink
! try a zero width joiner (not space) instead of contenteditable false
Browse files Browse the repository at this point in the history
partial reverse of ichord/At.js#423
  • Loading branch information
Spuds committed May 30, 2022
1 parent 5e4b8de commit acccd34
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/editableController.coffee
Expand Up @@ -163,12 +163,11 @@ class EditableController extends Controller
.addClass 'atwho-inserted'
.html content
.attr 'data-atwho-at-query', "" + data['atwho-at'] + @query.text
.attr 'contenteditable', "false"
if range = @_getRange()
if @query.el.length
range.setEndAfter @query.el[0]
range.collapse false
range.insertNode suffixNode = @app.document.createTextNode "" + suffix
range.insertNode suffixNode = @app.document.createTextNode "\u200B" + suffix
@_setRange 'after', suffixNode, range
@$inputor.focus() unless @$inputor.is ':focus'
@$inputor.change()

0 comments on commit acccd34

Please sign in to comment.