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

[0.8] extended my-input element isn't shown #1350

Closed
ragingwind opened this issue Mar 31, 2015 · 1 comment
Closed

[0.8] extended my-input element isn't shown #1350

ragingwind opened this issue Mar 31, 2015 · 1 comment

Comments

@ragingwind
Copy link
Contributor

I expected that I could see three input elements on body. but It wasn't. First element, declared by <my-input></my-input> isn't shown on page. I'm not sure that I've been using well extends property in Polymer. Something wrong in the code? I've followed primer guide

screen shot 2015-03-31 at 5 40 57 pm

<body>
<!-- declare my-input element -->
<my-input></my-input>
<script>
  var MyInput = Polymer({
    is: 'my-input',
    extends: 'input',
    created: function() {
      this.style.border = '1px solid red';
    }
  });

  var el1 = new MyInput();
  console.log(el1 instanceof HTMLInputElement); // true
  document.createElement('my-input', MyInput);

  var el2 = document.createElement('input', 'my-input');
  console.log(el2 instanceof HTMLInputElement); // true

  document.body.appendChild(el1); // Add input element has red solid border with MyInput
  document.body.appendChild(el2); // Add input element has red solid border with input element extended from my-input
</script>
</body>
@ragingwind
Copy link
Contributor Author

sorry I have misunderstood.

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

1 participant