DeuxHuitHuit / quicksearch

A jQuery plugin for searching through DOM Elements quickly
https://www.npmjs.org/package/jquery.quicksearch
Other
135 stars 35 forks source link

Doesn't work with HTML5 Search clear #3

Closed zoerooney closed 10 years ago

zoerooney commented 10 years ago

Started to search into the "why" of this, which lead me to here but I didn't get any further: http://stackoverflow.com/questions/2977023/how-do-you-detect-the-clearing-of-a-search-html5-input

nitriques commented 10 years ago

Can you give more detail on what's not working ? Can you give a code example ?

zoerooney commented 10 years ago

When you use the HTML5 search field, clicking to clear doesn't reset the filter. See: http://jsfiddle.net/XcZ8s/

nitriques commented 10 years ago

You just need to setup the right events. Use the bind property for that.

$('#searchfield2').quicksearch('ul#group2 li', {
    bind: 'search keydown'
});

See http://jsfiddle.net/XcZ8s/1/

nitriques commented 10 years ago

I think I may add it as a default

zoerooney commented 10 years ago

I do think it makes sense as a default as well, but thanks for the solution!

nitriques commented 10 years ago

Done in 2.0.2. http://plugins.jquery.com/jquery.quicksearch/2.0.2/ Hope you like it.

Concept211 commented 10 years ago

This is still not working on IE11 regardless of binding manually or not.

nitriques commented 10 years ago

are you using <input type="search" /> ? or text ?

Concept211 commented 10 years ago

using type="search"

Concept211 commented 10 years ago

You can reproduce it using the Super Table sample: http://deuxhuithuit.github.io/quicksearch/r/examples/super_table.html

I tested on 2 different machines running IE11 and same result with both. When you click the X to clear the type="search" field, it doesn't do anything. Seems like IE isn't firing the proper event?

nitriques commented 10 years ago

Seems like IE isn't firing the proper event?

Yup, according to this http://msdn.microsoft.com/en-us/library/ie/gg592978%28v=vs.85%29.aspx the event's called 'input' (a poor name IMHO).

I'll fix that right away. Thanks for reporting!

Concept211 commented 10 years ago

Thanks for the quick response! Please post here to let us know once the new build is ready and I'll test it out.

thanks again!

nitriques commented 10 years ago

There you go: http://plugins.jquery.com/jquery.quicksearch/2.0.3/ !

I tested it on IE11 and it works great. I even fixed some bugs in the exmaples!

input event is added by default BTW.

Concept211 commented 10 years ago

Works perfectly...thanks!

nitriques commented 10 years ago

Great!