Question

Strange phenomenon detected with JQuery 1.4.4 for FireF, Chrome, Safari (IE untestested). Aim: update a list while the user types a filter value into a simple, basic text-input-box. Solution: bound keyup event, read out the value of the input-field, apply the filter... roughly:

$("#myinputfield").keyup(function(e) { myList.filter($(this).val()) });

it works perfectly for both typing and deleting EXCEPT for when deleting (del or backspace same effect) the last remaining (==first) char. in that case the event does not fire at all. Anybody with an idea on what the problem is and/or how to solve it?

(p.s.: My solution would be to change from keyup event binding to a setTimeout periodical check as long as the input-field has focus, but that koxind of feels like a dirty escape...)

Was it helpful?

Solution

I cannot reproduce your problem. Perhaps it is just that your filter function does not handle $(this).val() == '' very well. Check out this quick test.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top