|
@@ -87,7 +87,8 @@ export default [
|
|
|
from?: number,
|
|
|
to?: number,
|
|
|
fromBytes?: number,
|
|
|
- toBytes?: number } = null;
|
|
|
+ toBytes?: number,
|
|
|
+ } = null;
|
|
|
|
|
|
/**
|
|
|
* Stop propagation of click events and hold htmlElement of the emojipicker
|
|
@@ -293,7 +294,7 @@ export default [
|
|
|
const text = getText(false);
|
|
|
if (text === '\n') {
|
|
|
composeDiv[0].innerText = '';
|
|
|
- } else if (ev.keyCode === 190) {
|
|
|
+ } else if (ev.keyCode === 190 && caretPosition !== null) {
|
|
|
// A ':' is pressed, try to parse
|
|
|
const currentWord = stringService.getWord(text, caretPosition.fromBytes, [':']);
|
|
|
if (currentWord.realLength > 2
|
|
@@ -308,7 +309,7 @@ export default [
|
|
|
}
|
|
|
|
|
|
// Update typing information (use text instead method)
|
|
|
- if (text.trim().length === 0) {
|
|
|
+ if (text.trim().length === 0 || caretPosition === null) {
|
|
|
stopTyping();
|
|
|
scope.onTyping('');
|
|
|
} else {
|