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

Added wait-time-ms option #464

Closed
wants to merge 4 commits into from

Conversation

ffesseler
Copy link

This allow to set a timeout before getMatchesAsync is called after the last key stroke.

This is useful when getting data from a remote source. Basically, you don't want to send the request on each stroke.

@pkozlowski-opensource
Copy link
Member

@ffesseler this is great stuff and I would be really keen on merging this!

But it doesn't merge cleanly at the moment as you seem to based your branch on the 2-months old code. Could you rebase it on top of the current master? I've also left some comments in the source code.

@ffesseler
Copy link
Author

Oops sorry, I didn't notice that.
I'll fix everything asap.

@ffesseler
Copy link
Author

Commited. Let me know if that's ok for you

@bekos
Copy link
Contributor

bekos commented May 29, 2013

@ffesseler I think there is something messed with you latest commits, because I can see the datepicker file in the changed files.

@ffesseler
Copy link
Author

aw :-(

I had some issues doing the rebase, I've probably typed something wrong.
Any idea how I can resolve this? I'm not comfortable with git at all

@bekos
Copy link
Contributor

bekos commented May 30, 2013

@ffesseler The last solution, would be to close this pull request and open a new one, over the latest master :-)

@pkozlowski-opensource
Copy link
Member

@ffesseler It got a bit messy and I'm not sure I will be able to guide you through exact git commands remontly. What I would probably do in this case is to create a new branch of a master:

git checkout master
git checkout -b typeahead-timeout

then cherry-pick commits with your changes:

git cherry-pick [your commit 1]
git cherry-pick [your commit 2]
git cherry-pick [your commit 3]

and then interactively rebase to squash commits:

git rebase -i HEAD~3

If this all sounds overwhelming you might want to look at git docs (there is excellent free book: http://git-scm.com/book).

If you are not into spending time messing with git (which IMO is worth learning well!) just open a new pull request, from a new branch created of the master with your code moved manually.

@pkozlowski-opensource
Copy link
Member

@ffesseler Haven't heard from you and had a bit of hard time to clean up your git history so in the end decide to re-do things in 7f35a3f.

Thnx for this PR and inspiration, the most important part is that the code landed in master!

@ffesseler
Copy link
Author

Sorry, I've been very busy lately. It was on my todo list but I wasn't able to find sometime to invest in all that git stuff.
Thanks for your help, glad it's now available in master :)

@socket70
Copy link

I've been playing with this and it seems not to work correctly. While there is a delay before the first async request is sent, if I type in 3 characters, it ultimately sends 3 async requests.

For example, a field that is used for looking people up from the server by last name, if I type in "smi" in firebug after the 1000ms delay i see 3 requests:

get s
get sm
get smi

Instead of just the last one.

@pkozlowski-opensource
Copy link
Member

@socket70 Please open another issue with a reproduce scenario.

@socket70
Copy link

Opened issue #573.

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

Successfully merging this pull request may close these issues.

4 participants