Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

ObservableList break in sdK and editor 1.4.0-dev.6.2, and polymer 0.10.0-pre11 and expressions 0.10.0.pre2 #18749

Closed
DartBot opened this Issue May 9, 2014 · 8 comments

Comments

Projects
None yet
2 participants

DartBot commented May 9, 2014

This issue was originally filed by joo.tsa...@gmail.com


see sample:

<!DOCTYPE html>

<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Sample app</title>
    <link rel="import" href="packages/polymer/polymer.html">
  </head>
  <body>
    <polymer-element name="x-a">
      <template>
        <div> Number in the a: {{ number[0] }}</div>
        <button on-click="{{ countClick }}" type="button">click</button>
      </template>
    </polymer-element>
    
    <x-a></x-a>
    
    <script type="application/dart;component=1">
      import 'dart:html';
      import 'package:polymer/polymer.dart';

      @­CustomTag('x-a')
      class XA extends PolymerElement {
        @­observable var number = toObservable([1]);
        XA.created(): super.created();

        void countClick(Event event, var detail, Node target) {
          number[0] += 1;
        }
      }
      </script>
  </body>
</html>

click button can't observe count change.

Member

sigmundch commented May 9, 2014

Thanks for the bug report. Also, thank you for the short sample! Examples like these are very useful and helpful to us.

From a quick look, it seems that the bug was there in polymer_expressions 0.10.0-pre.1 as well.

I need to investigate some more.


Removed Priority-Unassigned label.
Added Priority-Medium, Area-Polymer, Triaged labels.

DartBot commented May 19, 2014

This comment was originally written by joo...@gmail.com


This issue blocking the development and testing of our project.

DartBot commented May 27, 2014

This comment was originally written by joo...@gmail.com


This problem can fix it? we are waiting.

DartBot commented May 28, 2014

This comment was originally written by joo...@gmail.com


update follow example to listen list changed, but on click update data can't see list changes log. where the wrong?

<!DOCTYPE html>

<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Sample app</title>
    <link rel="import" href="packages/polymer/polymer.html">
  </head>
  <body>
    <polymer-element name="x-a">
      <template>
        <div> Number in the a: {{ number[0] }}</div>
        <button on-click="{{ countClick }}" type="button">click</button>
      </template>
    </polymer-element>
    
    <x-a></x-a>
    
    <script type="application/dart;component=1">
      import 'dart:html';
      import 'package:polymer/polymer.dart';

      @­CustomTag('x-a')
      class XA extends PolymerElement {
        @­observable var number = toObservable([1]);
        XA.created(): super.created() {
          number.changes.listen((records) {
            window.console.log('Changes: $records');
          });
        }

        void countClick(Event event, var detail, Node target) {
          number[0] += 1;
        }
      }
      </script>
  </body>
</html>

Member

sigmundch commented May 29, 2014

It seems that this break was there long time ago too. I was able to reproduce the same issue in polymer 0.9.5+2 as well.

I finally was able to track this down. The problem seems to be in how we listen to indexer expressions. I just sent a fix out for review:

https://codereview.chromium.org/308563002/

Member

sigmundch commented May 29, 2014

fixed in https://code.google.com/p/dart/source/detail?r=36782 and published the fix in polymer_expressions 0.10.0-pre.3


Added Fixed label.

Member

sigmundch commented May 29, 2014

Issue #19058 has been merged into this issue.

DartBot commented May 29, 2014

This comment was originally written by joo.ts...@gmail.com


Good news, thanks you for your hard work!

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment