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

fix(type): unify selection behavior when typing #3141

Merged
merged 1 commit into from
Jul 24, 2020
Merged

fix(type): unify selection behavior when typing #3141

merged 1 commit into from
Jul 24, 2020

Conversation

dgozman
Copy link
Contributor

@dgozman dgozman commented Jul 24, 2020

Before typing/pressing, we focus the target element. WebKit
sometimes selects the value in this case. To unify the behavior
between the browsers we behave similar to human:

  • when the input is already focused, we just type;
  • when the input is not focused, we focus it, move caret
    to the start (like if user clicked at the start to focus the input)
    and then type.
    Note this only affects inputs with non-empty value.

Fixes #2702.

Before typing/pressing, we focus the target element. WebKit
sometimes selects the value in this case. To unify the behavior
between the browsers we behave similar to human:
- when the input is already focused, we just type;
- when the input is not focused, we focus it, move caret
  to the start (like if user clicked at the start to focus the input)
  and then type.
Note this only affects inputs with non-empty value.
@dgozman dgozman requested a review from JoelEinbinder July 24, 2020 03:16
@dgozman dgozman merged commit 0f0e2ac into microsoft:master Jul 24, 2020
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 this pull request may close these issues.

[BUG] Webkit clears on page.type – Chromium/Firefox don't
2 participants