fix(fill): use HTMLInputElement.select (#406)

This commit is contained in:
Arjun Attam 2020-01-07 13:57:17 -08:00 committed by Yury Semikhatsky
parent f75ac45c42
commit 5c1f7cfb0c

View File

@ -366,8 +366,7 @@ export class ElementHandle<T extends Node = Node> extends js.JSHandle<T> {
return 'Cannot fill a disabled input.';
if (input.readOnly)
return 'Cannot fill a readonly input.';
input.selectionStart = 0;
input.selectionEnd = input.value.length;
input.select();
input.focus();
} else if (element.nodeName.toLowerCase() === 'textarea') {
const textarea = element as HTMLTextAreaElement;