From 7801e1a3ff7c4da48c73659b2fbc66ab0244b9a4 Mon Sep 17 00:00:00 2001 From: Viet Date: Fri, 25 May 2018 15:56:49 +0900 Subject: [PATCH] div:contenteditable update range for everytime focus event is triggered --- wdt-emoji-bundle.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wdt-emoji-bundle.js b/wdt-emoji-bundle.js index a75b451..ddbedbd 100644 --- a/wdt-emoji-bundle.js +++ b/wdt-emoji-bundle.js @@ -653,7 +653,7 @@ var s = window.getSelection(); if (!wdtEmojiBundle.ranges[this.dataset.rangeIndex]) { wdtEmojiBundle.ranges[this.dataset.rangeIndex] = new Range(); - } else if (s.rangeCount > 0) { + } else { s.removeAllRanges(); s.addRange(wdtEmojiBundle.ranges[this.dataset.rangeIndex]); }