jQuery 1.7.1 support?
Hi, I tried using this plugin with jQuery 1.7.1 and encountered the following nastiness:
Uncaught RangeError: Maximum call stack size exceeded
Sizzle
Sizzle
jQuery.fn.extend.find
(anonymous function)
jQuery.event.dispatch
jQuery.event.add.elemData.handle.eventHandle
jQuery.event.trigger
jQuery.fn.extend.trigger
jQuery.extend.each
jQuery.fn.jQuery.each
jQuery.fn.extend.trigger
jQuery.each.jQuery.fn.(anonymous function)
(anonymous function)
etc.
etc.
Works fine with 1.6.2. Am I doing something wrong or is this a known issue or a new bug?
Thanks!
If you comment out lines 157 to 165 this error goes away. Haven't quite worked out why those lines would be causing it yet though, will report back if I find out.
You can replace the lines 157 to 165:
e.bind("focusin", function(event) {
$(this)
.addClass("focused")
.find("input[type=text]")
.focus();
}).bind("focusout", function(event) {
$(this).removeClass("focused");
input.val("");
});
by those:
e.bind("focusin", function(event) {
$(this)
.addClass("focused")
.find("input[type=text]")
.focus(function (event) {
event.stopPropagation();
}).focus();
})
.bind("focusout", function(event) {
$(this).removeClass("focused");
});
That stops the event propagation to avoid resending the focus event (when the input is focused by line 160).
When the focus is out, the input should not be cleared, instead it should be cleared when we select a tag from the autocomplete:
after the line 258:
$(e).tagit("addTag", target.text());
add this line:
$(e).find("input[type=text]").val("");