-
Notifications
You must be signed in to change notification settings - Fork 13.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: Delete last list item in collection-repeat fails #3299
Comments
Fixing. |
Here's the crazy logic we need: function makeChangeValidator() {
var self;
return (self = {
dataLength: 0,
width: 0,
height: 0,
resizeRequiresRefresh: function(newWidth, newHeight) {
var requiresRefresh = self.dataLength &&
newWidth && newWidth !== self.width &&
newHeight && newHeight !== self.height;
self.width = newWidth;
self.height = newHeight;
return !!requiresRefresh;
},
dataChangeRequiresRefresh: function(newData) {
var requiresRefresh = newData.length > 0 || newData.length < self.dataLength;
self.dataLength = newData.length;
return !!requiresRefresh;
}
});
} Now all the cases are covered cleanly. |
Thank you so much! You were so fast resolving it ;) |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Type: bug
Platform: mobile webview
The new collection-repeat doesn't delete the last item in the list even though the list items array is empty.
I have an array with several items that are shown in the list by means of collection-repeat. When I delete whatever item but the last it works. But if I delete the last element, the item is still there until I tap or try to scroll.
I think it could be some view refresh that isn't executed or something like this.
I solved it by adding:
or (if deleting is done asynchronously):
The text was updated successfully, but these errors were encountered: