mirror of
https://github.com/fastmail/Squire.git
synced 2024-12-22 07:13:08 -05:00
If selection, delete contents before letting brower insert space
Fixes #213
This commit is contained in:
parent
aaf84870aa
commit
d4abc182c8
1 changed files with 7 additions and 0 deletions
|
@ -432,6 +432,13 @@ var keyHandlers = {
|
|||
!node.nextSibling && range.endOffset === getLength( node ) ) {
|
||||
range.setStartAfter( parent );
|
||||
}
|
||||
// Delete the selection if not collapsed
|
||||
else if ( !range.collapsed ) {
|
||||
deleteContentsOfRange( range, self._root );
|
||||
self._ensureBottomLine();
|
||||
self.setSelection( range );
|
||||
self._updatePath( range, true );
|
||||
}
|
||||
|
||||
self.setSelection( range );
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue