Why I am getting this error:
Uncaught RangeError: Maximum call stack size exceeded
Here is my code:
$(document).on('keypress focusout', '.checklist-item-input', function (e) {
if (e.which == 13 || e.type == 'focusout') {
$('.checklist-item').removeClass('edit');
$(this).siblings('.checklist-item-detail').text($(this).val());
$(this).blur();
$('.checklist-item-detail').each(function () {
if (!$(this).text().length) {
$(this).closest('.checklist-item').parent().remove();
}
});
}
});