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

Selected item becomes deselected when updated in firebase #103

Open
blasten opened this issue Jan 27, 2016 · 3 comments
Open

Selected item becomes deselected when updated in firebase #103

blasten opened this issue Jan 27, 2016 · 3 comments

Comments

@blasten
Copy link

blasten commented Jan 27, 2016

From: PolymerElements/iron-list#131

Steps to reproduce the issue:

  1. create an iron-list binded to a firebase collection element
  2. select an item
  3. update the item in firebase
  4. the selected item becomes unselected

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.

@eac
Copy link

eac commented Feb 6, 2016

I'm very new to polymer, so this may be unrelated, but I'm experiencing a similar issue using dom-repeat. I'm able to work around the behavior by adding a filter to the template that always returns true.

Repro:

<template is="dom-repeat" items="{{todos}}" as="todo">
  <paper-input label="Label" value="{{todo.label}}"></paper-input>
</template>

@tinders
Copy link

tinders commented Feb 18, 2016

I'm also new to polymer and having the same problem. Whenever a child is created with a dom-repeat, then it cannot seamlessly update itself via firebase. As every update fires, the data gets pushed back through from firebase and it triggers a recreation of the child. This has the effect of (for instance) blurring an input field on every key up event.

Filtering can fix it, but doesn't completely solve the issue. As in my case the dom-repeat list is dynamically populated and filtering it seems to break the functionality of the list.

Either it's a problem that anyone building complex apps with polymer/firebase faces, or we're structuring our apps incorrectly.

@MeTaNoV
Copy link
Contributor

MeTaNoV commented Mar 23, 2016

@blasten @eac @tinders This should be fixed thanks to #111 !

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

4 participants