googlearchive / firebase-util

An experimental toolset for Firebase
http://firebase.github.io/firebase-util
MIT License
276 stars 67 forks source link

Paginate: error removeChild #101

Open douwevdijk opened 7 years ago

douwevdijk commented 7 years ago

Hi,

I have another issue. It concerns when I remove a child from my collection and when the count is exactly the same as the pageSize. Basically it should fire the prev() function, but instead I get an error.

My code: I have 19 childs, am on page 2 and remove the 19th.

var pageRef = new Firebase.util.Paginate(ref, 'text', {pageSize: 18});

And the error:

FIREBASE WARNING: Exception was thrown by user callback. TypeError: Cannot read property 'toString' of null at n._keyChange (https://cdn.firebase.com/libs/firebase-util/0.2.5/firebase-util.min.js:10:4555) at https://cdn.firebase.com/libs/firebase-util/0.2.5/firebase-util.min.js:10:8916 at Array.forEach (native) at Object.c.each (https://cdn.firebase.com/libs/firebase-util/0.2.5/firebase-util.min.js:11:38) at n._notify (https://cdn.firebase.com/libs/firebase-util/0.2.5/firebase-util.min.js:10:8879) at n._doneSubscribing (https://cdn.firebase.com/libs/firebase-util/0.2.5/firebase-util.min.js:10:10612) at c (https://cdn.firebase.com/js/client/2.4.2/firebase.js:242:58) at https://cdn.firebase.com/js/client/2.4.2/firebase.js:203:710 at gc (https://cdn.firebase.com/js/client/2.4.2/firebase.js:52:165) at cc (https://cdn.firebase.com/js/client/2.4.2/firebase.js:30:216) firebase.js:52 Uncaught TypeError: Cannot read property 'toString' of null