Hacker News new | ask | show | jobs
by imjared 4920 days ago
On things to fix:

While I appreciate the use of history, I promise you I don't need to hold my position on the page for every single letter I type in the search box: http://screencast.com/t/1qFwxlz5

I ended up with a history entry for "search results for 'c'", "search results for 'co'", "search results for 'cog'", etc.

Maybe trim this down to only firing after 10s on inactivity in a text input or use onblur? I'm not too sure what the answer is but it (page history) definitely loses any usefulness when architected in this manner.

1 comments

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.

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.