-
Notifications
You must be signed in to change notification settings - Fork 131
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
Selected item becomes deselected when updated in firebase #131
Comments
Little bit more information on this. Firebase collection will invoke splice when it updates an item as it is shown in the following code line: this.splice('data', this.data.indexOf(oldValue), 1, value); The list will then deselect the element as it is removed from the array. _adjustVirtualIndex: function(splices) {
What would be the best way to solve this issue? should we change the iron-list code to be smarter or the firebase collection should not call splice and do something different when updating an object ? |
@albertolobrano This is tricky because calling |
Right now i added some logic to my component that re-select the item if it was selected. Let's see what @cdata thinks about it. |
Some kind of this problem appears to me: I have a iron-list which lists data from Firebase (with Firebase a problem didn't appear, but I haven't updated my data via Firebase) My code: It is pretty annoying!!! |
Yes this the issue that i reported. What it is happening is that when you update the object with the paper-input firebase will be notified and will update it self. When it does it i will remove and add the element to the list and it will become deselected |
This is what i did to solve the issue. It is ugly but it works until the issue will be fixed upstream
_updateSelectedItem: function(item, old) {
|
I hope @cdata could help here. |
This should probably be filed against GoogleWebComponents/firebase-element repo. |
moved! |
Steps to reproduce the issue:
Firebase collection uses : this.splice('data', this.data.indexOf(oldValue), 1, value); when it needs to update a value. Iron list as a result will delete and add the element to the list and in the process it will deselect.
I am not sure if this is an issue with the list or if the firebase component that maybe should use something more clever then splice. I am not an expert so i will live you this decision to you.
The text was updated successfully, but these errors were encountered: