Skip to content

[0.8-preview] Boolean attribute change handlers are called before localDom or lightDom are available. #1131

Closed
@cdata

Description

Considering the following contrived element built on 0.8-preview branch:

<script>
Polymer({
  is: 'simple-element',
  published: {
    awesome: Boolean
  },
  bind: {
    awesome: 'awesomeChanged'
  },
  ready: function () {
    console.log('I am ready.');
  },
  awesomeChanged: function () {
    if (this.lightDom && this.localDom) {
      console.log('I has a DOM');
    } else {
      console.log('I do not has DOM');
    }
  }
});
</script>

The first time awesomeChanged is called will happen before this.lightDom and this.localDom have been initialized on the element. It will also be called before the ready lifecycle handler has been called, which may or may not be intentional, but seems undesirable on the surface.

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions