Questions tagged [custom-element]

Custom Elements are a feature of HTML that provide a way for you to build your own fully-featured DOM elements and use them in your HTML markup, CSS stylesheets, and JavaScript code

Custom Elements are natively supported in all browsers, but for browsers that don’t yet implement them natively, some support is available through the use of a JavaScript polyfill.

Latest changes in Javascript / Ecmascript 2017, allow you to easily create HTML custom elements in an OOP like fashion that makes your code clear and your HTML mark-up more intuitive.

See also:

For a gallery of available custom elements check out WebComponents

973 questions
0
votes
1 answer

How to declare a property that will add a css class to my custom-element in Polymer 1.0

I make a custom-element which is a simple card whith some caption on it. The problem is, that i dont know how to declare a property that will add a css class to make the background-image url different between each card. I love Polymer, i can create…
0
votes
1 answer

How to nest polymer templates properly?

I recently started learning polymer and am trying to use iron-ajax iron-list and templates together. For some reason the values are showing blank on screen, but cards are getting created. Taking example from this question, I created two…
user568109
  • 47,225
  • 17
  • 99
  • 123
0
votes
1 answer

What's the best practice for referencing 3rd parties JS library in Polymer custom element?

Currently, I face some serious problem about duplicate referencing 3rd-parties library that causes some libraries to malfunction. This is the first custom element.
user94893
0
votes
1 answer

Polymer 1.0 auto binding templates

I am trying to get auto binding template to work with out success. This is what I have done so far. The page doesn't render with the value of "greeting" . It outputs {{greeting}}.
0
votes
3 answers

How to add xmlbean document element to soap header spring-ws

I am trying to hit a webservice using spring-ws, but the webservice producer requires a custom element in the soap header. I am very new to webservices, and am having trouble trying to inject the values into the soap header. I am using XMLBeans to…
Scott
  • 174
  • 5
  • 19
0
votes
0 answers

SVGTSpanElement.createShadowRoot doesn't work

Can you please help me with following code? In Webkit family, I see the shadow element (in developer tools), but doesn't appear at all on screen. In Firefox, it crashes! I suspect namespaces, because it works great for HTML elements like…
Chameleon
  • 1,804
  • 2
  • 15
  • 21
0
votes
1 answer

ZF2 How to set with a custom Form Element

How do I set checked within a form input radio field? This form field is added using a custom Form Element. The value of this field isn't consistent. My custom Form Element returns 1 element. It is a radio input field. I need this checked each…
Ron Piggott
  • 705
  • 1
  • 8
  • 26
0
votes
1 answer

Javascript Adding function to custom elements in the shadow root

I'm writing an app using shadow root, I found my self using shadow.children[i].addEventListener('click', fn); so much, so I tried to create a custom function to shorthand it, so I wrote: var $shadow = function(shadow, el, fn){ …
Hasan A Yousef
  • 22,789
  • 24
  • 132
  • 203
0
votes
1 answer

React 0.12.2: "Error: Lower case component names (paper-button) are no longer supported in JSX"

I am trying to use a web component (paper-icon-button) in a React component and I am getting the following error: Error: Lower case component names (paper-button) are no longer supported in JSX" error: See http://fb.me/react-jsx-lower-case As of…
senornestor
  • 4,075
  • 2
  • 33
  • 33
0
votes
2 answers

How can I use a javascript function to create polymer elements which can call javascript functions

I have an array of objects, each of which I want to render into polymer cord-card element. Each element when tapped, i'd like to call a javascript function. I've used a simple loop to create the elements with javascript however nothing happens when…
Akil A.
  • 3
  • 2
0
votes
3 answers

Remove child element's attribute from Polymer js

I've a custom element which, among other things, has a core-input and a paper button in it. When the element is created, the input is disabled, and I want to enable it when I tap the button. I've tried several ways and can't access the input's…
Iskalla
  • 381
  • 3
  • 17
0
votes
3 answers

How can I ignore the initial override of a default attribute on a Polymer element within the changed event handler for that attribute?

It seems like the changed event handler for any given attribute fires even when initializing the element the first time with a value other than the default value for that attribute. For example, let's say I have the following custom Polymer…
natlee75
  • 5,097
  • 3
  • 34
  • 39
0
votes
1 answer

Polymer: Create a "general" custom element

I am attempting to build an element with attributes that would specify which element should take place of this element. I have a 3d-card flip element that I am using fo this purposes in the index.html that is defined as: …
Igor L.
  • 3,159
  • 7
  • 40
  • 61
0
votes
1 answer

Why custom element fails to link to interleave whilst linking to filesinks works ok?

I've got my own custom element, lets call it MyElement. It has request sink pads, and sometimes source pads. When a source pad is created, MyElement emits a signal which can be intercepted by user. In callback registered with this signal, user can…
Buyuk
  • 1,094
  • 1
  • 8
  • 23
0
votes
1 answer

Styles applied to custom polymer element only inside an element with layout attribute

I have a custom polymer element inside body element. If I add styles like width : 100px to the custom element, they are not applied. But once I add vertical layout to the body element, the rules get applied. Can somebody please explain why is this…
Vlas Bashynskyi
  • 1,886
  • 2
  • 16
  • 25