From 624964828771085e16a1dcc05ae1c1c8cfa7a488 Mon Sep 17 00:00:00 2001 From: Jason Chen Date: Sat, 30 Jul 2016 15:55:40 -0700 Subject: [PATCH] fix #824 Firefox moves the cursor upon deleting last character of format --- modules/keyboard.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/keyboard.js b/modules/keyboard.js index f48026df61..c357329ddc 100644 --- a/modules/keyboard.js +++ b/modules/keyboard.js @@ -38,7 +38,7 @@ class Keyboard extends Module { }); this.addBinding({ key: Keyboard.keys.ENTER, shiftKey: null }, handleEnter); this.addBinding({ key: Keyboard.keys.ENTER, metaKey: null, ctrlKey: null, altKey: null }, function() {}); - this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: true, prefix: /^$/ }, function(range) { + this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: true, prefix: /^.?$/ }, function(range) { if (range.index === 0) return; this.quill.deleteText(range.index - 1, 1, Quill.sources.USER); this.quill.selection.scrollIntoView();