Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

More-Routing fix for iron-selector 1.0.8 #77

Open
TheMoonDawg opened this issue Oct 29, 2015 · 10 comments
Open

More-Routing fix for iron-selector 1.0.8 #77

TheMoonDawg opened this issue Oct 29, 2015 · 10 comments

Comments

@TheMoonDawg
Copy link

The newest version of iron-selector (1.0.8) changed the way the 'items' array is accessed. As a result, our more-routing component broke because it wouldn't find any of the registered routes.

We ended up fixing this by placing an event listener on '_managedSelector' in more-routing-selector.html.

In the 'attached()' function in more-routing-selector.html, place this line below the 'selected-item-changed' event listener delcaration:

this._managedSelector.addEventListener('iron-items-changed', this._updateRoutes.bind(this));

This line fixed more-routing for us with the latest version of iron-selector. Hopefully it can help someone else as well!

@addyosmani
Copy link
Contributor

Thanks for sharing the workaround. Is this issue meant as more of an FYI for posterity or is this a request for us to patch this into more-routing? Imo, given that the fix appears to be coupled to iron-items it may not make sense to land it directly in master.

@TheMoonDawg
Copy link
Author

This was more of a FYI for anyone having trouble after updating to the latest version of iron-selector.

We spent hours tracking down the issue, and my main goal was to help anyone else having a similar problem.

@alefwmm
Copy link

alefwmm commented Nov 6, 2015

+1

@prijindal
Copy link

+1 Even I tried it any it started causing problem after updating iron-selector to 1.0.8

@Compufreak345
Copy link

Thanks for the workaround, finally found a solution for my issues :)

So is this considered as a bug for iron-selector or do I have to maintain a fork of more-routing with this fix in place forever? It's my first time using more-routing so I'm not sure how it is supposed to work - but the example in the Readme.md did not work without this workaround - doesn't this qualify this as a major issue of some kind?

Compufreak345 added a commit to Compufreak345/more-routing that referenced this issue Nov 7, 2015
@keithguerin
Copy link

Can you please deploy 1.0.2 to bower? Would have saved us a lot of trouble if this component had updated automatically :)

@Compufreak345
Copy link

@keithguerin I think you are referring to my fork, where I implemented 2 fixes/workarounds mentioned here in issues or pull requests. You could use these by calling

bower install git://github.com/Compufreak345/more-routing/

But after I was pointed to this post (last 2 paragraphs) I would recommend thinking about switching to another router (page.js or excess-router) and/or keeping an eye open for the solution provided by the polymer-team, hopefully coming soon. I myself am currently switching to excess-router and will not maintain my more-routing fork any more (except for pull requests).

P.S.: I was pointed to the post in an issue at app-router, that unfortunately also does not work with Polymer 1.0.

@addyosmani It would be great if some note about the plans and alternatives would find its way into the documentation of more-routing as me and probably others started using this project without knowing of these plans.

@sgoryachkin
Copy link

It is linked problem PolymerElements/iron-selector#89

@seintelligence
Copy link

+1 ! thank you

@jurr90
Copy link

jurr90 commented Jul 14, 2016

_updateRoutes: function() {
var routes = [];

var self = this;
setTimeout(function() {
if (self._managedSelector) {
  routes = self._managedSelector.items.map(self._routeForItem.bind(self));
}
self._setRoutes(routes);
}, 100)

},

Hi, I added this quick fix, and now iron-pages work well.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants