Update emoticons.js

- Prevents jumping back to the first position if an emoticon is pressed several times
This commit is contained in:
Frank Hochmuth 2024-03-02 21:47:43 +01:00 committed by GitHub
parent 461a5f1986
commit f72d731e3f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7,7 +7,7 @@ function insertAtCursor(myField, myValue) {
sel = document.selection.createRange();
sel.text = myValue;
}
else if (myField.selectionStart || myField.selectionStart == '0') {
else if (myField.selectionStart || myField.selectionStart == 0.1) {
var startPos = myField.selectionStart;
var endPos = myField.selectionEnd;
myField.value = myField.value.substring(0, startPos) + myValue + myField.value.substring(endPos, myField.value.length);