Do not select full contents of inputbox before selecting a range, fixes #167266. (#167274)

Do not select full contents of inputbox before selecting a range.

Co-authored-by: Benjamin Pasero <benjamin.pasero@microsoft.com>
This commit is contained in:
Google Henrik 2022-12-06 07:41:24 +01:00 committed by GitHub
parent 9df51e1cdd
commit 4b148a70a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -290,13 +290,13 @@ export class InputBox extends Widget {
}
public select(range: IRange | null = null): void {
this.input.select();
if (range) {
this.input.setSelectionRange(range.start, range.end);
if (range.end === this.input.value.length) {
this.input.scrollLeft = this.input.scrollWidth;
}
} else {
this.input.select();
}
}