PolymerElements / app-route

A modular client-side router

Home Page:https://www.polymer-project.org/1.0/articles/routing.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

active set before data in 2.0-preview

mbinette opened this issue · comments

For some reason the active property now gets updated before the data property. So if you were observing active and using data within the observer, it is now the wrong value.

<app-route route="{{route}}" pattern="/view/:id" data="{{routeData}}" active="{{active}}"></app-route>

properties: { active: { type: Boolean, value: false, observer: 'onActive', },

When onActive is called, routeData.id will be whatever it was previously and not what is was just changed to. In Polymer 1.x branch this was not the case. routeData.id was set and then onActive was called.

This was tested in Chrome with Polymer 2.0.0-rc.3, webcomponentsjs 1.0.0-rc.6, and app-route 2.0.0

Currently using version 2.0.2 and this issue is still happening.

Looks like active property is updated aside the batch update (here), even if the batch update also contains the active property itself (here).

Also related to #148.