jstayton/jquery-manifest — Issue #2: Calling values in an add or remove callback returns old values
Author: sambs
Created: 2011-10-13 09:26:15+00:00
State: open

Currently the add and remove methods trigger their respective events before the DOM is updated:

add = self._trigger('add', [value, $item]);

if (add !== false) {
$item.appendTo(self.$list);
}

Therefore, if you call the values method in an add or remove callback you get the previous set of values (without the newly added or removed item). Is this intentional? It would seem more natural to me if the dom was updated first.

if (add !== false) {
$item.appendTo(self.$list);
}

add = self._trigger('add', [value, $item]);