fix #1745: deleting selected text in auto-type selector

This commit is contained in:
antelle 2021-03-13 10:11:32 +01:00
parent 1593acd8e9
commit 0def3f8b2d
No known key found for this signature in database
GPG Key ID: 63C9777AAB7C563C
2 changed files with 13 additions and 4 deletions

View File

@ -177,10 +177,18 @@ class AutoTypeSelectView extends View {
backSpacePressed() {
if (this.model.filter.text) {
this.model.filter.text = this.model.filter.text.substr(
0,
this.model.filter.text.length - 1
);
const input = this.el.querySelector('.at-select__header-filter-input');
if (input.selectionStart < input.selectionEnd) {
this.model.filter.text =
this.model.filter.text.substr(0, input.selectionStart) +
this.model.filter.text.substr(input.selectionEnd);
input.selectionStart = input.selectionEnd = 0;
} else {
this.model.filter.text = this.model.filter.text.substr(
0,
this.model.filter.text.length - 1
);
}
this.render();
}
}

View File

@ -2,6 +2,7 @@ Release notes
-------------
##### v1.17.2 (TBD)
`-` fixed crashes in the USB module on Windows
`-` fix #1745: deleting selected text in auto-type selector
##### v1.17.1 (2021-03-10)
`-` fix #1735: issue with auto-typing some characters on Windows