PolymerElements / iron-pages

Simple content switcher
https://www.webcomponents.org/element/PolymerElements/iron-pages
48 stars 19 forks source link

iron-activate event not firing #44

Open ghost opened 7 years ago

ghost commented 7 years ago

I am trying to get default routes working in my application with nested app-route and iron-pages by binding fallback-selector to app-location. It works, but I need this to work across multiple sub-elements of my application, and if all the iron-pages elements update the location, it fritzes the app into an endless loop of location changes.

To make it work, in each sub-element I need to verify whether the correct route is active, and if it isn't I need to cancel the fallback selection on iron-pages. The iron-select event is firing, the iron-activate is not.

    <app-location route="{{route}}"></app-location>

    <app-route
        route="{{route}}"
        pattern="/account/:page"
        active="{{isActiveRoute}}">
    </app-route>

    <iron-pages
      id="pages"
      selected="{{route.path}}"
      attr-for-selected="name"
      fallback-selection="/account/login"
      on-iron-activate="_pageActivate"
      on-iron-select="_pageSelect">

      <pk-account-login name="/account/login"></pk-account-login>

    </iron-pages>
ergo commented 7 years ago

Same here, never got iron-activate to work.