Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Fix: issue #877 Typing fast in firefox skips the second character #1785

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

piebe
Copy link

@piebe piebe commented Aug 26, 2016

Changing the focus on elements does not always go fast enough in firefox to reliably catch all keystrokes. This fix changes the order of events, and keeps catching keystrokes after the first until the focus has shifted.

(I messed up the original pull request #896) Also see #877

@@ -163,8 +161,12 @@ uis.controller('uiSelectCtrl',
};

ctrl.focusSearchInput = function (initSearchValue) {
ctrl.search = initSearchValue || ctrl.search;
if (initSearchValue) {
ctrl.search = initSearchValue.val() || ctrl.search;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't agree that initSearchValue should be a DOM element, angular controllers should avoid dealing with DOM. Can you look at leaving this as text string?

Copy link
Author

@piebe piebe Aug 29, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. I adjusted the code.

@Plus3531
Copy link

Plus3531 commented Sep 9, 2016

I would like to use the fix in this pull request because it is rather annoying that the second character is skipped while typing fast.
I'm waiting for the fix to be merged with the master. Could you please tell me when this pull request will be merged?

@lekzd
Copy link

lekzd commented Oct 12, 2016

@Plus3531
I made temporary solution -> https://gist.github.com/lekzd/42c6d7e36e9c9fc21c42c335ef9b7ef9
this directive records all user input before all digest actions ends and forsible writes it to $select.search

@aaronroberson
Copy link
Contributor

@piebe Can you add tests and possibly a Plunkr example for quicker evaluation?

@piebe
Copy link
Author

piebe commented Jan 11, 2017

I love to help but...

I am not sure what you want to see in the plunkr. As described in #877 the problem can be reproduced in the standard demo plunkr using Firefox.

Also I do not know how to create a test to simulate fast typing by a user in Firefox.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants