Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

polymer declarative event doesn't work in lightdom mode #331

Closed
frankiefu opened this issue Oct 25, 2013 · 5 comments
Closed

polymer declarative event doesn't work in lightdom mode #331

frankiefu opened this issue Oct 25, 2013 · 5 comments

Comments

@frankiefu
Copy link
Member

When lightdom attribute is set on polymer-element, declarative event doesn't seem to work.

<polymer-element name="x-foo" lightdom>
  <template>
    <div id="bar" on-click="{{clickHandler}}">Click Me and background color should change to red.</div>
  </template>
  <script>
    Polymer('x-foo', {
      clickHandler: function() {
        this.$.bar.style.backgroundColor = 'red';
      }
    });
  </script>
</polymer-element>

<x-foo></x-foo>

Clicking on #bar doesn't invoke clickHandler().

jsbin: http://jsbin.com/UfECAra/1/edit

@forresto
Copy link

Duplicated with 0.1.1: http://jsbin.com/itAPuxac/5/edit ... code copied from docs

@ebidel
Copy link
Contributor

ebidel commented Dec 28, 2013

Due to this issue, I also had to abandon the lightdom attribute for the site's left nav.
Polymer/old-docs-site@4cb9f79

bergie added a commit to noflo/noflo-ui that referenced this issue Jan 2, 2014
@forresto
Copy link

Looks like this is still broken in 0.1.4: http://jsbin.com/itAPuxac/7/edit

on-click is a pretty foundational thing to be broken for 4 months. What's the story?

@ebidel
Copy link
Contributor

ebidel commented Feb 11, 2014

FYI, the lightdom attr will be removed in the next release:
googlearchive/polymer-dev@abac5f0

It was always considered experimental, creating a lot of bugs like this. Should we close this?

@sorvell
Copy link
Contributor

sorvell commented Feb 11, 2014

We've eliminated the 'lightdom' attribute on polymer-element. This was done mainly because users found it confusing as the capabilities of a template stamped into ShadowDOM are different from one stamped into light dom.

That said, we think there are use cases for elements putting other elements inside their light dom and we want to allow support for this. Thus, this bug was fixed. The 'lightFromTemplate' method is available as a helper method allowing stamping of a template into light DOM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants