riklomas / quicksearch

A jQuery plugin for searching through tables, lists, etc quickly
http://www.lomalogue.com/jquery/quicksearch/
680 stars 261 forks source link

Quicksearch 'unhides' hidden table rows during initialization #43

Open worktheweb opened 12 years ago

worktheweb commented 12 years ago

During init the query string is "" so quicksearch sets the style.display to "" which unhides it.

You can fix this by adding a filter to the lines that build jq_results (line 106 or so) and t (line 112 or so). jq_results = $(target).not(':hidden')

worktheweb commented 12 years ago

Well that was a partial fix because if you initialize a quicksearch that is on a hidden tab or something similar it fails. I ended up changing it to this.

jq_results = $(target).filter(function(){return !$(this).css('visibility')=='hidden' || $(this).css('display')=='none');});

Hope this helps someone else. Great plugin otherwise!