You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a bug with registering handlers inside x-repeats that exists in Polymer 0.8.0-rc.2. All handlers inside the template will refer to the first instance of the element containing the template instead of the correct instance. This looks to be fixed in the latest 0.8 branches, but I want to make sure that future release candidates will work correctly.
In templatizer.html, the "templatize" function is only run once per template. Therefore this code:
Will only be run once, and so this.host will always refer to the first instance of the element that contains the template. A quick fix is to simply refer to the host within the function:
The example below attempts to show the problem. x-bar contains a template with a button that will call handleTap when pressed. x-foo contains two instances of x-bar, and regardless of which button is pushed, the this in handleTap will always refer to the first x-bar, x-bar#bar1.
There is a bug with registering handlers inside x-repeats that exists in Polymer 0.8.0-rc.2. All handlers inside the template will refer to the first instance of the element containing the template instead of the correct instance. This looks to be fixed in the latest 0.8 branches, but I want to make sure that future release candidates will work correctly.
In templatizer.html, the "templatize" function is only run once per template. Therefore this code:
Will only be run once, and so
this.host
will always refer to the first instance of the element that contains the template. A quick fix is to simply refer to the host within the function:The example below attempts to show the problem.
x-bar
contains a template with a button that will callhandleTap
when pressed.x-foo
contains two instances ofx-bar
, and regardless of which button is pushed, thethis
inhandleTap
will always refer to the firstx-bar
,x-bar#bar1
.The text was updated successfully, but these errors were encountered: