Browse Source

FIX(editor): Fix delete character which has more than one UTF-16 code unit using `Delete` key. close the issue #9834 (#9837)

such as delete 🤔(U+1F914), 𠀅(U+20005)
gfgafn 2 years ago
parent
commit
8a2c6e9537
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/main/frontend/handler/editor.cljs

+ 2 - 1
src/main/frontend/handler/editor.cljs

@@ -2696,7 +2696,8 @@
             (delete-concat current-block)))
 
         :else
-        (delete-and-update input current-pos (inc current-pos))))))
+        (delete-and-update 
+          input current-pos (util/safe-inc-current-pos-from-start (.-value input) current-pos))))))
 
 (defn keydown-backspace-handler
   [cut? e]