Editing input field in a Polymer Dart templatizer instance throws an error

Issue

We have a polymer element written in dart (version 1.0.0-rc.18).
The <list-outer> element uses the Templatizer behavior to iterate an object list.

<list-outer>
    <template>               
        <iron-label>{{row.name}}</iron-label>
        <paper-input value="{{row.name}}"></paper-input>
    </template>
</list-outer>

The dart part:

@PolymerRegister('list-outer')
class ListOuter extends PolymerElement with Templatizer {

  @property
  List<Object> datax = [
    {"name": "xxx", "age": 2},
    {"name": "yyy", "age": 3}
  ];

  ListOuter.created() : super.created() ;

  @override
  void ready() {   
    Element template = Polymer.dom(this).querySelector('template');

    this.templatize(template);

    datax.forEach((row) {
      TemplateInstance instance = this.stamp({});

      Polymer.dom(this).append(instance.root);

      instance.set('row', row);
    });
  }
}

If I try to edit the data in the inner <paper-input> we always get the exception below. Maybe we are missing something, but don’t know what.

**Uncaught TypeError: dataHost._templatized._notifyPath is not a function**
Polymer.Templatizer._notifyPathUpImpl @ index.html
_ijt=afoakvu673o0o9qkl500u98qfp:11533Polymer.Base._addFeature._notifyPath @ index.html
_ijt=afoakvu673o0o9qkl500u98qfp:8009Polymer.Base._addFeature.set @ index.html
_ijt=afoakvu673o0o9qkl500u98qfp:8108(anonymous function) @ index.html
_ijt=afoakvu673o0o9qkl500u98qfp:7118Polymer.Base._addFeature._notifyListener @ index.html
_ijt=afoakvu673o0o9qkl500u98qfp:7885(anonymous function) @ index.html
_ijt=afoakvu673o0o9qkl500u98qfp:7151Polymer.Base._addFeature.fire @ index.html
_ijt=afoakvu673o0o9qkl500u98qfp:6627Polymer.Bind._modelApi._notifyChange @ index.html
_ijt=afoakvu673o0o9qkl500u98qfp:6904Polymer.Base.extend._notifyEffect @ index.html
_ijt=afoakvu673o0o9qkl500u98qfp:7185Polymer.Bind._modelApi._effectEffects @ index.html
_ijt=afoakvu673o0o9qkl500u98qfp:6962Polymer.Bind._modelApi._propertySetter @ index.html
_ijt=afoakvu673o0o9qkl500u98qfp:6937setter @ index.html

Solution

Seems as a variant of a known bug in js Polymer.

https://github.com/Polymer/polymer/issues/3899

For the research, see comments.

Answered By – Jonas Bojesen

Answer Checked By – Marie Seifert (FlutterFixes Admin)

Leave a Reply

Your email address will not be published.