Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing to set selectionStart on email type inputs #365

Closed
arjunattam opened this issue Jan 3, 2020 · 0 comments · Fixed by #406
Closed

Failing to set selectionStart on email type inputs #365

arjunattam opened this issue Jan 3, 2020 · 0 comments · Fixed by #406

Comments

@arjunattam
Copy link
Contributor

(testing Playwright and Studio on VSO login flow)

after #353 was merged, I ran into a new error in trying to fill in the email in the VSO login flow (screenshot below for reference)

Error: Evaluation failed: DOMException: Failed to set the 'selectionStart' 
property on 'HTMLInputElement': The input element's type ('email') 
does not support selection.

This error is caused by the lines at https://github.com/microsoft/playwright/blob/master/src/input.ts#L349 where we assume the selectionStart attribute exists on the input. After #353 this assumption is incorrect, since the email type does not support it.

    input.selectionStart = 0;
    input.selectionEnd = input.value.length;

Commenting these two lines fixes this particular issue, and I could send a PR to not execute these lines for email and other invalid types. Would that be a good idea?

Screen Shot 2020-01-03 at 10 16 43 AM

sand4rt pushed a commit to sand4rt/playwright that referenced this issue Dec 21, 2022
Co-authored-by: Max Schmitt <max@schmitt.mx>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant