mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
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:
parent
9df51e1cdd
commit
4b148a70a8
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue