3 ms·
Interesting, but I can't help feeling that a better implementation would be to split ethe input on white space, and build a slightly more complex selector such
by kbenson 13y ago
Interesting, but I can't help feeling that a better implementation would be to split ethe input on white space, and build a slightly more complex selector such that a search for "term1 term2" would set the style to:
.searchable { display: none; }
.searchable[data-index*="term1"][date-index*="term2"] { display; block; }
and an empty input would hav eno selectors (or .searchable {display:block;} ).
It's slightly more code, but much more usable.
- adambom 13y agoI ended up implementing it this way. Nice idea. Just FYI there's a typo on line two (display; block should be display: block). Got stuck on that for about 5 minutes. That's what I get for copy pasting :)