mirror of
https://github.com/fastmail/Squire.git
synced 2024-12-22 07:13:08 -05:00
Fix backspace can delete two characters
If we're handling the backspace completely ourselves, must prevent default to stop the browser also having a go.
This commit is contained in:
parent
137c8f0b17
commit
cf30a69b89
1 changed files with 1 additions and 0 deletions
|
@ -94,6 +94,7 @@ const Backspace = (self: Squire, event: KeyboardEvent, range: Range): void => {
|
|||
text.deleteData(offset - 1, 1);
|
||||
self.setSelection(range);
|
||||
self.removeLink();
|
||||
event.preventDefault();
|
||||
} else {
|
||||
// Otherwise, leave to browser but check afterwards whether it has
|
||||
// left behind an empty inline tag.
|
||||
|
|
Loading…
Reference in a new issue