Hacker News new | ask | show | jobs
by wallunit 4920 days ago
The primary reason why I am using the history API, is that you can bookmark and send links to a specific search. However I agree that when you are actually using the history, it becomes annoying to have any search that was executed while you were typing in your history.

However when updating the history only every 10s, you might have to wait until you can copy the link to your search from the address bar. And if you aren't typing fast enough there still can be incomplete searches in your history.

Using onblur would be better. But what would you think about, updating the history as soon, as the cursor is moved? I think I like that idea pretty much.

1 comments

I think http://caniuse.com handles this situation quite well (try searching for something). Notice the short delay between a keypress and the URL updating.
They reset the timout everytime you type another letter. That approach seems to work quite well, unless you are a very slow typer.

However I have just implemented another approach to deal with that issue. Now, the history is updated either when the current field lost focus or when you move the mouse, after you entered something. Please try it out and let me know what you think.