mirror of
https://github.com/fastmail/Squire.git
synced 2025-01-18 04:32:28 -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);
|
text.deleteData(offset - 1, 1);
|
||||||
self.setSelection(range);
|
self.setSelection(range);
|
||||||
self.removeLink();
|
self.removeLink();
|
||||||
|
event.preventDefault();
|
||||||
} else {
|
} else {
|
||||||
// Otherwise, leave to browser but check afterwards whether it has
|
// Otherwise, leave to browser but check afterwards whether it has
|
||||||
// left behind an empty inline tag.
|
// left behind an empty inline tag.
|
||||||
|
|
Loading…
Add table
Reference in a new issue