Closed mwinters-stuff closed 7 years ago
same issue here.
-- EDIT --
I have changed my firebase-query.html
code to the once @wintersandroid proposed and it works like a charm.
Same problem with the Polymer2.0 preview rc and this is a solution.
Can you fix this problem in a PR?
Good Job and thanks @wintersandroid
Works like a charm.
Thanks @wintersandroid !
Thanks @wintersandroid !
Yeah need to fix this problem in a PR
I will fork it now and submit a PR...
merged into 2.0-preview
Description
When using the polymer 2.0 preview, The firebase-query element returns the data array with the data duplicated. Eg, if the queried data on the server has 7 items, the firebase-query has 14, each item is listed twice.
Expected outcome
You get the 7 items with no duplicates.
Actual outcome
No specific example, just query a path and check the results.
Whats happening.
The __queryChanged is called more than once for the query, which seems to add more than one "child_added" e.t.c. event handlers.
Solve
I solved this by changing query changed to remove handlers if they were previously registered. ` queryChanged: function(query, oldQuery) {
`