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 {
181181 document .addEventListener (' selectionchange' , () => {
182182 var selection = document .getSelection ()
183183 if (
184+ selection .anchorNode &&
184185 selection .anchorNode != this .$refs .userInput &&
185186 selection .anchorNode .parentNode != this .$refs .userInput
186187 ) {
@@ -307,7 +308,9 @@ export default {
307308 _insertEmoji (emoji ) {
308309 var range = this .previousSelectionRange
309310 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+ }
311314 range = document .createRange ()
312315 range .setStart (this .$refs .userInput .firstChild , this .$refs .userInput .textContent .length )
313316 range .collapse (true )
You can’t perform that action at this time.
0 commit comments