slate icon indicating copy to clipboard operation
slate copied to clipboard

Feature: Add a configurable keypress delay before initiating search

Open evilstickman opened this issue 8 years ago • 1 comments

Take a look at http://docs.backand.com

Navigate partway down the page, then try to type out "user" - you will see a delay between pressing 'u' and then completing the word, as the search executes on every keyup event.

We'd like to see a configurable timeout for this functionality - some sort of delay after a keypress, to ensure that the user has actually finished typing prior to the search. I did some hacking on this using the suggestions at http://stackoverflow.com/questions/1909441/how-to-delay-the-keyup-handler-until-the-user-stops-typing, but ran into a wall getting it to preserve the event.

In an ideal world, I'd like to see an extra option in index.html.md - search_timeout - which sets the search keypress timeout in milliseconds. Using this, the search wouldn't initiate until after the user has finished typing, or at least paused long enough where the search delay won't be a burden. I'd suggest a default pause of 300 milliseconds.

In my mind this is both a bug fix and a new feature, but I classified it as a feature.

evilstickman avatar Mar 24 '17 18:03 evilstickman

Great idea. Thanks for the suggestion!

lord avatar Mar 29 '17 03:03 lord