Skip to content
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

Conflict with array-selector when updating an item in firebase #81

Open
albertolobrano opened this issue Oct 29, 2015 · 0 comments
Open

Comments

@albertolobrano
Copy link
Contributor

When an item in firebase get's updated the components call the following code. The given code will call splices on the array which causes any selected item to be deselected.

_onFirebaseChildChanged: function(event) {
this._applyRemoteDataChange(function() {
var value = this._valueFromSnapshot(event.detail.childSnapshot);
var oldValue = this._valueMap[value.firebaseKey];

      if (!oldValue) {
        this._error('Received firebase-child-changed event for unknown child "' + value.__firebaseKey__ + '"');
        return;
      }

      this._valueMap[oldValue.__firebaseKey__] = null;
      this._valueMap[value.__firebaseKey__] = value;
      this.splice('data', this.data.indexOf(oldValue), 1, value);
    });
  },
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant