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

<Input /> element inside trigger gets focused unintentionally on mobile devices #621

Open
raido opened this issue Jun 11, 2021 · 2 comments

Comments

@raido
Copy link
Contributor

raido commented Jun 11, 2021

Here we handle target.focus() call, so if we have following template:

<dd.Trigger>
  <input type="text" />
</dd.Trigger>

It will always forcefully focus the element when user happens to start scroll on mobile having touch point on the trigger/input element.

@cibernox
Copy link
Owner

That was kind of intentional, so users can start typing (and filtering) the options immediately.
What improvement do you suggest? Make the focus in optional?

@raido
Copy link
Contributor Author

raido commented Jun 11, 2021

Could we wrap target.focus() with "hasMoved()" check as well, so there is certain threshold before focus() is called?

In my app with current implementation if I want to quickly scroll to bottom of my "view" and I happen to hit trigger element, then it is impossible to scroll down because input gets focused and browser viewport is scrolled back to element at hand.

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

No branches or pull requests

2 participants