Don't terminate selection dragging when a modifier key is pressed

This preserves the ability to add selections via ctrl- or cmd-click.
This commit is contained in:
Nathan Sobo
2017-11-01 09:21:13 -06:00
parent 6b9deee5a7
commit 11511f27d5
2 changed files with 18 additions and 5 deletions

View File

@@ -1666,7 +1666,7 @@ class TextEditorComponent {
// Stop dragging when user interacts with the keyboard. This prevents
// unwanted selections in the case edits are performed while selecting text
// at the same time.
if (this.stopDragging) this.stopDragging()
if (this.stopDragging && event.key !== 'Control' && event.key !== 'Alt' && event.key !== 'Meta') this.stopDragging()
if (this.lastKeydownBeforeKeypress != null) {
if (this.lastKeydownBeforeKeypress.code === event.code) {