Skip to content

Commit

Permalink
fastmail#472 added the ability to delete non editable elements by pre…
Browse files Browse the repository at this point in the history
…ssing backspace
  • Loading branch information
Alexander Gratzl committed Jan 13, 2025
1 parent cb2a860 commit 8626a37
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion source/keyboard/Backspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,10 @@ const Backspace = (self: Squire, event: KeyboardEvent, range: Range): void => {
self.setSelection(range);
self.removeLink();
event.preventDefault();
} else {
} else if(a instanceof HTMLElement && !a.isContentEditable) {
self.getSelection().selectNode(a);
}
else {
// Otherwise, leave to browser but check afterwards whether it has
// left behind an empty inline tag.
self.setSelection(range);
Expand Down

0 comments on commit 8626a37

Please sign in to comment.