I am trying to integrate At.js into Trix editor so that I can @mention users.
$('trix-editor').atwho({
at: "@",
data:['Peter', 'Tom', 'Anne']
})
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdn.rawgit.com/basecamp/trix/master/dist/trix.js"></script>
<script src="https://cdn.rawgit.com/ichord/At.js/master/dist/js/jquery.atwho.js"></script>
<script src="https://cdn.rawgit.com/ichord/Caret.js/master/dist/jquery.caret.js"></script>
<link href="https://cdn.rawgit.com/basecamp/trix/master/dist/trix.css" rel="stylesheet"/>
<link href="https://cdn.rawgit.com/ichord/At.js/master/dist/css/jquery.atwho.css" rel="stylesheet"/>
Trix Editor:
<form action='#'>
<input id="x" type="hidden" name="content" value="Type @">
<trix-editor input="x"></trix-editor>
</form>
As you can see in the example above, the popup appears, but when you select an item you get the following error: jquery.atwho.js:686 The given range isn't in document.
What does "The given range isn't in document" mean where should I start looking to debug it?