File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -181,6 +181,7 @@ export default {
181
181
document .addEventListener (' selectionchange' , () => {
182
182
var selection = document .getSelection ()
183
183
if (
184
+ selection .anchorNode &&
184
185
selection .anchorNode != this .$refs .userInput &&
185
186
selection .anchorNode .parentNode != this .$refs .userInput
186
187
) {
@@ -307,7 +308,9 @@ export default {
307
308
_insertEmoji (emoji ) {
308
309
var range = this .previousSelectionRange
309
310
if (! range) {
310
- console .log (' First child: ' + this .$refs .userInput .firstChild )
311
+ if (! this .$refs .userInput .firstChild ) {
312
+ this .$refs .userInput .append (document .createTextNode (' ' ))
313
+ }
311
314
range = document .createRange ()
312
315
range .setStart (this .$refs .userInput .firstChild , this .$refs .userInput .textContent .length )
313
316
range .collapse (true )
You can’t perform that action at this time.
0 commit comments