ember-basic-dropdown
ember-basic-dropdown copied to clipboard
<Input /> element inside trigger gets focused unintentionally on mobile devices
https://github.com/cibernox/ember-basic-dropdown/blob/4596ed5475c47f90038dad44dd11c0dac6e34d12/addon/components/basic-dropdown-trigger.ts#L112
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.
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?
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.